Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_compass.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_compass.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_compass.h
r8127 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 9 9 10 10 #ifndef QWT_COMPASS_H 11 #define QWT_COMPASS_H 111 #define QWT_COMPASS_H 12 12 13 13 #include "qwt_global.h" 14 14 #include "qwt_dial.h" 15 15 #include "qwt_round_scale_draw.h" 16 #include <qstring.h>17 #include <qmap.h>18 16 19 17 class QwtCompassRose; 18 class QString; 19 template< class Key, class T > class QMap; 20 20 21 21 22 /*! 22 \brief A special scale draw made for QwtCompass 23 \brief A special scale draw made for QwtCompass 23 24 24 QwtCompassScaleDraw maps values to strings using 25 a special map, that can be modified by the application 25 QwtCompassScaleDraw maps values to strings using 26 a special map, that can be modified by the application 26 27 27 The default map consists of the labels N, NE, E, SE, S, SW, W, NW. 28 The default map consists of the labels N, NE, E, SE, S, SW, W, NW. 28 29 29 \sa QwtCompass 30 */ 31 class QWT_EXPORT QwtCompassScaleDraw: public QwtRoundScaleDraw 30 \sa QwtCompass 31 */ 32 class QWT_EXPORT QwtCompassScaleDraw : public QwtRoundScaleDraw 32 33 { 33 public: 34 public: 34 35 explicit QwtCompassScaleDraw(); 35 explicit QwtCompassScaleDraw( const QMap<double, QString > &map );36 explicit QwtCompassScaleDraw( const QMap< double, QString >& map ); 36 37 37 void setLabelMap( const QMap<double, QString> &map ); 38 QMap<double, QString> labelMap() const; 38 virtual ~QwtCompassScaleDraw(); 39 39 40 virtual QwtText label( double value ) const; 40 void setLabelMap( const QMap< double, QString >& map ); 41 QMap< double, QString > labelMap() const; 41 42 42 private: 43 QMap<double, QString> d_labelMap; 43 virtual QwtText label( double value ) const QWT_OVERRIDE; 44 45 private: 46 class PrivateData; 47 PrivateData* m_data; 44 48 }; 45 49 46 50 /*! 47 \brief A Compass Widget 51 \brief A Compass Widget 48 52 49 QwtCompass is a widget to display and enter directions. It consists 50 of a scale, an optional needle and rose. 53 QwtCompass is a widget to display and enter directions. It consists 54 of a scale, an optional needle and rose. 51 55 52 \image html dials1.png 56 \image html dials1.png 53 57 54 \note The examples/dials example shows how to use QwtCompass. 55 */ 58 \note The examples/dials example shows how to use QwtCompass. 59 */ 56 60 57 class QWT_EXPORT QwtCompass: public QwtDial 61 class QWT_EXPORT QwtCompass : public QwtDial 58 62 { 59 63 Q_OBJECT 60 64 61 public: 65 public: 62 66 explicit QwtCompass( QWidget* parent = NULL ); 63 67 virtual ~QwtCompass(); 64 68 65 void setRose( QwtCompassRose *rose );66 const QwtCompassRose *rose() const;67 QwtCompassRose *rose();69 void setRose( QwtCompassRose* rose ); 70 const QwtCompassRose* rose() const; 71 QwtCompassRose* rose(); 68 72 69 protected: 70 virtual void drawRose( QPainter *, const QPointF¢er,73 protected: 74 virtual void drawRose( QPainter*, const QPointF& center, 71 75 double radius, double north, QPalette::ColorGroup ) const; 72 76 73 virtual void drawScaleContents( QPainter *,74 const QPointF ¢er, double radius ) const;77 virtual void drawScaleContents( QPainter*, 78 const QPointF& center, double radius ) const QWT_OVERRIDE; 75 79 76 virtual void keyPressEvent( QKeyEvent * );80 virtual void keyPressEvent( QKeyEvent* ) QWT_OVERRIDE; 77 81 78 private: 82 private: 79 83 class PrivateData; 80 PrivateData *d_data;84 PrivateData* m_data; 81 85 }; 82 86
Note:
See TracChangeset
for help on using the changeset viewer.
