QwtCompass is a widget to display and enter directions. It consists of a scale, an optional needle and rose.
Definition at line 48 of file qwt_compass.h.
Public Member Functions | |
QwtCompass (QWidget *parent=NULL) | |
virtual | ~QwtCompass () |
void | setRose (QwtCompassRose *rose) |
const QwtCompassRose * | rose () const |
QwtCompassRose * | rose () |
const QMap< double, QString > & | labelMap () const |
QMap< double, QString > & | labelMap () |
void | setLabelMap (const QMap< double, QString > &map) |
Protected Member Functions | |
virtual QwtText | scaleLabel (double value) const |
virtual void | drawRose (QPainter *, const QPoint ¢er, int radius, double north, QPalette::ColorGroup) const |
virtual void | drawScaleContents (QPainter *, const QPoint ¢er, int radius) const |
virtual void | keyPressEvent (QKeyEvent *) |
QwtCompass::QwtCompass | ( | QWidget * | parent = NULL |
) | [explicit] |
Constructor.
parent | Parent widget |
Definition at line 50 of file qwt_compass.cpp.
QwtCompass::~QwtCompass | ( | ) | [virtual] |
void QwtCompass::setRose | ( | QwtCompassRose * | rose | ) |
Set a rose for the compass
rose | Compass rose |
Definition at line 157 of file qwt_compass.cpp.
References rose().
const QwtCompassRose * QwtCompass::rose | ( | ) | const |
Definition at line 173 of file qwt_compass.cpp.
Referenced by setRose().
QwtCompassRose * QwtCompass::rose | ( | ) |
const QMap< double, QString > & QwtCompass::labelMap | ( | ) | const |
Definition at line 256 of file qwt_compass.cpp.
QMap< double, QString > & QwtCompass::labelMap | ( | ) |
Definition at line 265 of file qwt_compass.cpp.
void QwtCompass::setLabelMap | ( | const QMap< double, QString > & | map | ) |
Set a map, mapping values to labels.
map | value to label map |
Definition at line 282 of file qwt_compass.cpp.
QwtText QwtCompass::scaleLabel | ( | double | value | ) | const [protected, virtual] |
Map a value to a corresponding label
value | Value that will be mapped |
Reimplemented from QwtDial.
Definition at line 297 of file qwt_compass.cpp.
void QwtCompass::drawRose | ( | QPainter * | painter, | |
const QPoint & | center, | |||
int | radius, | |||
double | north, | |||
QPalette::ColorGroup | cg | |||
) | const [protected, virtual] |
Draw the compass rose
painter | Painter | |
center | Center of the compass | |
radius | of the circle, where to paint the rose | |
north | Direction pointing north, in degrees counter clockwise | |
cg | Color group |
Definition at line 143 of file qwt_compass.cpp.
Referenced by drawScaleContents().
void QwtCompass::drawScaleContents | ( | QPainter * | , | |
const QPoint & | center, | |||
int | radius | |||
) | const [protected, virtual] |
Draw the contents of the scale.
Reimplemented from QwtDial.
Definition at line 114 of file qwt_compass.cpp.
References drawRose(), QwtAbstractSlider::isValid(), QwtDial::mode(), QwtDial::origin(), and QwtDoubleRange::value().
void QwtCompass::keyPressEvent | ( | QKeyEvent * | kev | ) | [protected, virtual] |
Handles key events
Beside the keys described in QwtDial::keyPressEvent numbers from 1-9 (without 5) set the direction according to their position on the num pad.
Reimplemented from QwtDial.
Definition at line 196 of file qwt_compass.cpp.
References QwtAbstractSlider::isReadOnly(), QwtDial::keyPressEvent(), QwtDial::mode(), QwtDial::origin(), QwtAbstractSlider::setValue(), and QwtDoubleRange::value().