Files
GoldenCheetah/qwt/examples/dials/attitude_indicator.h
Damien 2f9130cd76 Qwt 6.0.1 Support
Upgrade to QWT 6.0.1, but still uses a locally patched copy
since support for 8 axes has not been included, despite it
being a relatively simple patch.

Fixes #634.
Fixes #567.
2012-02-12 10:43:15 +00:00

40 lines
914 B
C++

#include <qwt_dial.h>
#include <qwt_dial_needle.h>
class AttitudeIndicatorNeedle: public QwtDialNeedle
{
public:
AttitudeIndicatorNeedle(const QColor &);
protected:
virtual void drawNeedle(QPainter *,
double length, QPalette::ColorGroup) const;
};
class AttitudeIndicator: public QwtDial
{
Q_OBJECT
public:
AttitudeIndicator(QWidget *parent = NULL);
double angle() const { return value(); }
double gradient() const { return d_gradient; }
public Q_SLOTS:
void setGradient(double);
void setAngle(double angle) { setValue(angle); }
protected:
virtual void keyPressEvent(QKeyEvent *);
virtual void drawScale(QPainter *, const QPointF &center,
double radius, double origin, double arcMin, double arcMax) const;
virtual void drawScaleContents(QPainter *painter,
const QPointF &center, double radius) const;
private:
double d_gradient;
};