mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-13 12:42:20 +00:00
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.
40 lines
914 B
C++
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 ¢er,
|
|
double radius, double origin, double arcMin, double arcMax) const;
|
|
|
|
virtual void drawScaleContents(QPainter *painter,
|
|
const QPointF ¢er, double radius) const;
|
|
|
|
private:
|
|
double d_gradient;
|
|
};
|