You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
888 B
40 lines
888 B
|
3 years ago
|
#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 ¢er, double radius ) const;
|
||
|
|
|
||
|
|
virtual void drawScaleContents( QPainter *painter,
|
||
|
|
const QPointF ¢er, double radius ) const;
|
||
|
|
|
||
|
|
private:
|
||
|
|
double d_gradient;
|
||
|
|
};
|