~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to qwt-5.1.1/examples/dials/attitude_indicator.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2008-05-26 10:26:31 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080526102631-bp95mfccnrb957nx
Tags: 5.1.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

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