37 map.insert( 0.0, QString::fromLatin1(
"N" ) );
38 map.insert( 45.0, QString::fromLatin1(
"NE" ) );
39 map.insert( 90.0, QString::fromLatin1(
"E" ) );
40 map.insert( 135.0, QString::fromLatin1(
"SE" ) );
41 map.insert( 180.0, QString::fromLatin1(
"S" ) );
42 map.insert( 225.0, QString::fromLatin1(
"SW" ) );
43 map.insert( 270.0, QString::fromLatin1(
"W" ) );
44 map.insert( 315.0, QString::fromLatin1(
"NW" ) );
47 map.insert( 22.5, QString::fromLatin1(
"NNE" ) );
48 map.insert( 67.5, QString::fromLatin1(
"NEE" ) );
49 map.insert( 112.5, QString::fromLatin1(
"SEE" ) );
50 map.insert( 157.5, QString::fromLatin1(
"SSE" ) );
51 map.insert( 202.5, QString::fromLatin1(
"SSW" ) );
52 map.insert( 247.5, QString::fromLatin1(
"SWW" ) );
53 map.insert( 292.5, QString::fromLatin1(
"NWW" ) );
54 map.insert( 337.5, QString::fromLatin1(
"NNW" ) );
118 if ( qFuzzyCompare( value + 1.0, 1.0 ) )
190 const QPointF &
center,
double radius )
const 192 QPalette::ColorGroup cg;
194 cg = hasFocus() ? QPalette::Active : QPalette::Inactive;
196 cg = QPalette::Disabled;
205 const int margin = 4;
206 drawRose( painter, center, radius - margin, 360.0 - north, cg );
219 double radius,
double north, QPalette::ColorGroup cg )
const 277 if ( kev->key() == Key_5 )
284 double newValue =
value();
286 if ( kev->key() >= Qt::Key_1 && kev->key() <= Qt::Key_9 )
291 switch ( kev->key() )
294 newValue = 180.0 * 0.0;
297 newValue = 180.0 * 0.25;
300 newValue = 180.0 * 0.5;
303 newValue = 180.0 * 0.75;
306 newValue = 180.0 * 1.0;
309 newValue = 180.0 * 1.25;
312 newValue = 180.0 * 1.5;
315 newValue = 180.0 * 1.75;
328 #include "moc_qwt_compass.cpp"
void setScale(double lowerBound, double upperBound)
Specify a scale.
virtual ~QwtCompass()
Destructor.
enum MQTTPropertyCodes value
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
virtual void keyPressEvent(QKeyEvent *) QWT_OVERRIDE
void setValue(double value)
virtual void setOrigin(double)
Change the origin.
virtual QwtText label(double value) const QWT_OVERRIDE
void setScaleMaxMajor(int ticks)
Set the maximum number of major tick intervals.
QwtDial class provides a rounded range control.
virtual void drawRose(QPainter *, const QPointF ¢er, double radius, double north, QPalette::ColorGroup) const
void setTotalSteps(uint)
Set the number of steps.
virtual ~QwtCompassScaleDraw()
Destructor.
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 QWT_OVERRIDE
QwtCompassScaleDraw()
Constructor.
void setScaleDraw(QwtRoundScaleDraw *)
void setLabelMap(const QMap< double, QString > &map)
Set a map, mapping values to labels.
QMap< double, QString > labelMap() const
virtual void keyPressEvent(QKeyEvent *) QWT_OVERRIDE
QMap< double, QString > labelMap