Subversion Repositories Projects

Rev

Rev 227 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 KeyOz 1
#include <QObject>
2
#include <qwt_dial.h>
3
#include <qwt_dial_needle.h>
4
 
5
class AttitudeIndicatorNeedle: public QwtDialNeedle
6
{
7
public:
8
    AttitudeIndicatorNeedle(const QColor &);
9
 
10
    virtual void draw(QPainter *, const QPoint &, int length,
11
        double direction, QPalette::ColorGroup) const;
12
};
13
 
14
class AttitudeIndicator: public QwtDial
15
{
16
    Q_OBJECT
17
 
18
public:
19
    AttitudeIndicator(QWidget *parent = NULL);
20
 
21
    double angle() const { return value(); }
22
    double gradient() const { return d_gradient; }
23
 
24
public slots:
25
    void setGradient(double);
26
    void setAngle(double angle) { setValue(angle); }
27
 
28
protected:
29
    virtual void keyPressEvent(QKeyEvent *);
30
 
31
    virtual void drawScale(QPainter *, const QPoint &center, int radius, double origin, double arcMin, double arcMax) const;
32
 
33
    virtual void drawScaleContents(QPainter *painter, const QPoint &center, int radius) const;
34
 
35
private:
36
    double d_gradient;
37
};