29 #ifndef QCGAUGEWIDGET_H 30 #define QCGAUGEWIDGET_H 36 #include <QtCore/qmath.h> 41 #if defined(QCGAUGE_COMPILE_LIBRARY) 42 # define QCGAUGE_DECL Q_DECL_EXPORT 43 #elif defined(QCGAUGE_USE_LIBRARY) 44 # define QCGAUGE_DECL Q_DECL_IMPORT 80 void addItem(
QcItem* item,
float position);
81 int removeItem(
QcItem* item);
82 QList <QcItem*> items();
90 void paintEvent(QPaintEvent *);
102 explicit QcItem(QObject *parent = 0);
103 virtual void draw(QPainter *) = 0;
106 void setPosition(
float percentage);
113 QRectF adjustRect(
float percentage);
114 float getRadius(
const QRectF &);
115 float getAngle(
const QPointF&,
const QRectF &tmpRect);
116 QPointF getPoint(
float deg,
const QRectF &tmpRect);
135 void setValueRange(
float minValue,
float maxValue);
136 void setDgereeRange(
float minDegree,
float maxDegree);
137 void setMinValue(
float minValue);
138 void setMaxValue(
float maxValue);
139 void setMinDegree(
float minDegree);
140 void setMaxDegree(
float maxDegree);
147 float getDegFromValue(
float);
164 void draw(QPainter*);
165 void addColor(
float position,
const QColor& color);
183 void draw(QPainter*);
197 virtual void draw(QPainter *);
198 void setAngle(
float);
200 void setText(
const QString &text,
bool repaint =
true);
202 void setColor(
const QColor& color);
220 void draw(QPainter*);
221 void setColor(
const QColor& color);
241 void draw(QPainter*);
242 void setColors(
const QList<QPair<QColor,float> >& colors);
245 QPainterPath createSubBand(
float from,
float sweep);
258 void draw(QPainter *painter);
259 void setStep(
float step);
260 void setColor(
const QColor& color);
261 void setSubDegree(
bool );
276 void draw(QPainter*);
277 void setCurrentValue(
float value);
278 float currentValue();
279 void setValueFormat(QString format);
280 QString currentValueFormat();
281 void setColor(
const QColor & color);
294 void createDiamonNeedle(
float r);
295 void createTriangleNeedle(
float r);
296 void createFeatherNeedle(
float r);
297 void createAttitudeNeedle(
float r);
298 void createCompassNeedle(
float r);
313 void draw(QPainter*);
314 void setStep(
float step);
315 void setColor(
const QColor& color);
330 void draw(QPainter *);
331 void setCurrentPitch(
float pitch);
332 void setCurrentRoll(
float roll);
341 QPointF getIntersection(
float r,
const QPointF& pitchPoint,
const QPointF& pt);
342 float getStartAngle(
const QRectF& tmpRect);
344 void drawDegrees(QPainter *);
345 void drawDegree(QPainter * painter,
const QRectF& tmpRect,
float deg);
346 void drawUpperEllipse(QPainter *,
const QRectF&);
347 void drawLowerEllipse(QPainter *,
const QRectF&);
348 void drawPitchSteps(QPainter *,
const QRectF&);
349 void drawHandle(QPainter *);
350 void drawSteps(QPainter *,
float);
354 #endif // QCGAUGEWIDGET_H
QList< QPair< QColor, float > > mBandColors
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
virtual void draw(QPainter *)=0
QLinearGradient mLinearGrad
QList< QPair< float, QColor > > mColors