00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_COMPASS_H
00011 #define QWT_COMPASS_H 1
00012
00013 #include <qstring.h>
00014 #include <qmap.h>
00015 #include "qwt_dial.h"
00016
00017 #if defined(QWT_TEMPLATEDLL)
00018
00019 #if defined(QT_NO_STL) || QT_VERSION < 0x040000 || QT_VERSION > 0x040001
00020
00021
00022
00023
00024
00025
00026
00027
00028 template class QWT_EXPORT QMap<double, QString>;
00029
00030 #endif
00031
00032 #endif
00033
00034
00035 class QwtCompassRose;
00036
00048 class QWT_EXPORT QwtCompass: public QwtDial
00049 {
00050 Q_OBJECT
00051
00052 public:
00053 explicit QwtCompass( QWidget* parent = NULL);
00054 #if QT_VERSION < 0x040000
00055 explicit QwtCompass(QWidget* parent, const char *name);
00056 #endif
00057 virtual ~QwtCompass();
00058
00059 void setRose(QwtCompassRose *rose);
00060 const QwtCompassRose *rose() const;
00061 QwtCompassRose *rose();
00062
00063 const QMap<double, QString> &labelMap() const;
00064 QMap<double, QString> &labelMap();
00065 void setLabelMap(const QMap<double, QString> &map);
00066
00067 protected:
00068 virtual QwtText scaleLabel(double value) const;
00069
00070 virtual void drawRose(QPainter *, const QPoint ¢er,
00071 int radius, double north, QPalette::ColorGroup) const;
00072
00073 virtual void drawScaleContents(QPainter *,
00074 const QPoint ¢er, int radius) const;
00075
00076 virtual void keyPressEvent(QKeyEvent *);
00077
00078 private:
00079 void initCompass();
00080
00081 class PrivateData;
00082 PrivateData *d_data;
00083 };
00084
00085 #endif