Qwt User's Guide 6.1.0

- Main Page
- Related Pages
- Classes

All Classes Functions Variables Typedefs Enumerations Enumerator Pages
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