30 d_labelMap.insert( 0.0, QString::fromLatin1(
"N" ) );
31 d_labelMap.insert( 45.0, QString::fromLatin1(
"NE" ) );
32 d_labelMap.insert( 90.0, QString::fromLatin1(
"E" ) );
33 d_labelMap.insert( 135.0, QString::fromLatin1(
"SE" ) );
34 d_labelMap.insert( 180.0, QString::fromLatin1(
"S" ) );
35 d_labelMap.insert( 225.0, QString::fromLatin1(
"SW" ) );
36 d_labelMap.insert( 270.0, QString::fromLatin1(
"W" ) );
37 d_labelMap.insert( 315.0, QString::fromLatin1(
"NW" ) );
40 d_labelMap.insert( 22.5, QString::fromLatin1(
"NNE" ) );
41 d_labelMap.insert( 67.5, QString::fromLatin1(
"NEE" ) );
42 d_labelMap.insert( 112.5, QString::fromLatin1(
"SEE" ) );
43 d_labelMap.insert( 157.5, QString::fromLatin1(
"SSE" ) );
44 d_labelMap.insert( 202.5, QString::fromLatin1(
"SSW" ) );
45 d_labelMap.insert( 247.5, QString::fromLatin1(
"SWW" ) );
46 d_labelMap.insert( 292.5, QString::fromLatin1(
"NWW" ) );
47 d_labelMap.insert( 337.5, QString::fromLatin1(
"NNW" ) );
104 if ( qFuzzyCompare( value + 1.0, 1.0 ) )
173 const QPointF ¢er,
double radius )
const 175 QPalette::ColorGroup cg;
177 cg = hasFocus() ? QPalette::Active : QPalette::Inactive;
179 cg = QPalette::Disabled;
188 const int margin = 4;
189 drawRose( painter, center, radius - margin, 360.0 - north, cg );
202 double radius,
double north, QPalette::ColorGroup cg )
const 260 if ( kev->key() == Key_5 )
267 double newValue =
value();
269 if ( kev->key() >= Qt::Key_1 && kev->key() <= Qt::Key_9 )
274 switch ( kev->key() )
277 newValue = 180.0 * 0.0;
280 newValue = 180.0 * 0.25;
283 newValue = 180.0 * 0.5;
286 newValue = 180.0 * 0.75;
289 newValue = 180.0 * 1.0;
292 newValue = 180.0 * 1.25;
295 newValue = 180.0 * 1.5;
298 newValue = 180.0 * 1.75;
void setScale(double lowerBound, double upperBound)
Specify a scale.
virtual ~QwtCompass()
Destructor.
The needle is fixed, the scales are rotating.
QwtCompass(QWidget *parent=NULL)
Constructor.
void setRose(QwtCompassRose *rose)
virtual void draw(QPainter *painter, const QPointF ¢er, double radius, double north, QPalette::ColorGroup colorGroup=QPalette::Active) const =0
void setValue(double val)
virtual void setOrigin(double)
Change the origin.
void setScaleMaxMajor(int ticks)
Set the maximum number of major tick intervals.
QwtDial class provides a rounded range control.
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
virtual void keyPressEvent(QKeyEvent *)
virtual void drawRose(QPainter *, const QPointF ¢er, double radius, double north, QPalette::ColorGroup) const
void setTotalSteps(uint)
Set the number of steps.
A class representing a text.
Abstract base class for a compass rose.
const QwtCompassRose * rose() const
Backbone = the line where the ticks are located.
void setScaleMaxMinor(int ticks)
Set the maximum number of minor tick intervals.
A special scale draw made for QwtCompass.
void enableComponent(ScaleComponent, bool enable=true)
virtual void drawScaleContents(QPainter *, const QPointF ¢er, double radius) const
QwtCompassScaleDraw()
Constructor.
void setScaleDraw(QwtRoundScaleDraw *)
virtual void keyPressEvent(QKeyEvent *)
QMap< double, QString > d_labelMap
void setLabelMap(const QMap< double, QString > &map)
Set a map, mapping values to labels.
virtual QwtText label(double value) const
QMap< double, QString > labelMap() const