#include <qwt_dial_needle.h>
Public Member Functions | |
virtual void | draw (QPainter *painter, const QPointF ¢er, double length, double direction, QPalette::ColorGroup=QPalette::Active) const |
const QPalette & | palette () const |
QwtDialNeedle () | |
virtual void | setPalette (const QPalette &) |
virtual | ~QwtDialNeedle () |
Protected Member Functions | |
virtual void | drawKnob (QPainter *, double width, const QBrush &, bool sunken) const |
virtual void | drawNeedle (QPainter *painter, double length, QPalette::ColorGroup colorGroup) const =0 |
QwtDialNeedle is a pointer that indicates a value by pointing to a specific direction.
Qwt is missing a set of good looking needles. Contributions are very welcome.
QwtDialNeedle::QwtDialNeedle | ( | ) |
Constructor.
QwtDialNeedle::~QwtDialNeedle | ( | ) | [virtual] |
Destructor.
void QwtDialNeedle::draw | ( | QPainter * | painter, | |
const QPointF & | center, | |||
double | length, | |||
double | direction, | |||
QPalette::ColorGroup | colorGroup = QPalette::Active | |||
) | const [virtual] |
Draw the needle
painter | Painter | |
center | Center of the dial, start position for the needle | |
length | Length of the needle | |
direction | Direction of the needle, in degrees counter clockwise | |
colorGroup | Color group, used for painting |
void QwtDialNeedle::drawKnob | ( | QPainter * | painter, | |
double | width, | |||
const QBrush & | brush, | |||
bool | sunken | |||
) | const [protected, virtual] |
Draw the knob.
virtual void QwtDialNeedle::drawNeedle | ( | QPainter * | painter, | |
double | length, | |||
QPalette::ColorGroup | colorGroup | |||
) | const [protected, pure virtual] |
Draw the needle.
The origin of the needle is at position (0.0, 0.0 ) pointing in direction 0.0 ( = east ).
The painter is already initilaized with translation and rotation.
painter | Painter | |
length | Length of the needle | |
colorGroup | Color group, used for painting |
Implemented in QwtDialSimpleNeedle, QwtCompassMagnetNeedle, and QwtCompassWindArrow.
const QPalette & QwtDialNeedle::palette | ( | ) | const |
void QwtDialNeedle::setPalette | ( | const QPalette & | palette | ) | [virtual] |
Sets the palette for the needle.
palette | New Palette |