Qwt User's Guide: qwt_compass.h Source File

Qwt User's Guide 6.1.5

qwt_compass.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10 #ifndef QWT_COMPASS_H
11 #define QWT_COMPASS_H 1
12
13 #include "qwt_global.h"
14 #include "qwt_dial.h"
15 #include "qwt_round_scale_draw.h"
16 #include <qstring.h>
17 #include <qmap.h>
18
19 class QwtCompassRose;
20
31 class QWT_EXPORT QwtCompassScaleDraw: public QwtRoundScaleDraw
32 {
33 public:
34 explicit QwtCompassScaleDraw();
35 explicit QwtCompassScaleDraw( const QMap<double, QString> &map );
36
37 void setLabelMap( const QMap<double, QString> &map );
38 QMap<double, QString> labelMap() const;
39
40 virtual QwtText label( double value ) const;
41
42 private:
43 QMap<double, QString> d_labelMap;
44 };
45
57 class QWT_EXPORT QwtCompass: public QwtDial
58 {
59 Q_OBJECT
60
61 public:
62 explicit QwtCompass( QWidget* parent = NULL );
63 virtual ~QwtCompass();
64
65 void setRose( QwtCompassRose *rose );
66 const QwtCompassRose *rose() const;
67 QwtCompassRose *rose();
68
69 protected:
70 virtual void drawRose( QPainter *, const QPointF &center,
71 double radius, double north, QPalette::ColorGroup ) const;
72
73 virtual void drawScaleContents( QPainter *,
74 const QPointF &center, double radius ) const;
75
76 virtual void keyPressEvent( QKeyEvent * );
77
78 private:
79 class PrivateData;
80 PrivateData *d_data;
81 };
82
83 #endif
QwtCompass
A Compass Widget.
Definition: qwt_compass.h:57
QwtCompassScaleDraw
A special scale draw made for QwtCompass.
Definition: qwt_compass.h:31
QwtText
A class representing a text.
Definition: qwt_text.h:51
QwtDial::drawScaleContents
virtual void drawScaleContents(QPainter *painter, const QPointF &center, double radius) const
Definition: qwt_dial.cpp:508
QwtAbstractScaleDraw::label
virtual QwtText label(double) const
Convert a value into its representing label.
Definition: qwt_abstract_scale_draw.cpp:374
QwtDial
QwtDial class provides a rounded range control.
Definition: qwt_dial.h:49
QwtCompassRose
Abstract base class for a compass rose.
Definition: qwt_compass_rose.h:21
QwtAbstractSlider::keyPressEvent
virtual void keyPressEvent(QKeyEvent *)
Definition: qwt_abstract_slider.cpp:365
QwtRoundScaleDraw
A class for drawing round scales.
Definition: qwt_round_scale_draw.h:30