Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_dial_needle.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (4 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_dial_needle.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_dial_needle.h
r9383 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_DIAL_NEEDLE_H 11 #define QWT_DIAL_NEEDLE_H 111 #define QWT_DIAL_NEEDLE_H 12 12 13 13 #include "qwt_global.h" … … 15 15 16 16 class QPainter; 17 class QPoint;18 17 19 18 /*! 20 \brief Base class for needles that can be used in a QwtDial. 19 \brief Base class for needles that can be used in a QwtDial. 21 20 22 QwtDialNeedle is a pointer that indicates a value by pointing 23 to a specific direction. 21 QwtDialNeedle is a pointer that indicates a value by pointing 22 to a specific direction. 24 23 25 \sa QwtDial, QwtCompass 26 */ 24 \sa QwtDial, QwtCompass 25 */ 27 26 28 27 class QWT_EXPORT QwtDialNeedle 29 28 { 30 public: 29 public: 31 30 QwtDialNeedle(); 32 31 virtual ~QwtDialNeedle(); 33 32 34 virtual void setPalette( const QPalette & );35 const QPalette &palette() const;33 virtual void setPalette( const QPalette& ); 34 const QPalette& palette() const; 36 35 37 virtual void draw( QPainter *painter, const QPointF¢er,36 virtual void draw( QPainter*, const QPointF& center, 38 37 double length, double direction, 39 38 QPalette::ColorGroup = QPalette::Active ) const; 40 39 41 protected: 40 protected: 42 41 /*! 43 \brief Draw the needle 42 \brief Draw the needle 44 43 45 The origin of the needle is at position (0.0, 0.0 ) 46 pointing in direction 0.0 ( = east ). 44 The origin of the needle is at position (0.0, 0.0 ) 45 pointing in direction 0.0 ( = east ). 47 46 48 The painter is already initialized with translation and 49 rotation. 47 The painter is already initialized with translation and 48 rotation. 50 49 51 \param painter Painter 52 \param length Length of the needle 53 \param colorGroup Color group, used for painting 50 \param painter Painter 51 \param length Length of the needle 52 \param colorGroup Color group, used for painting 54 53 55 \sa setPalette(), palette() 56 */ 57 virtual void drawNeedle( QPainter *painter,54 \sa setPalette(), palette() 55 */ 56 virtual void drawNeedle( QPainter* painter, 58 57 double length, QPalette::ColorGroup colorGroup ) const = 0; 59 58 60 virtual void drawKnob( QPainter *, double width,61 const QBrush &, bool sunken ) const;59 virtual void drawKnob( QPainter*, double width, 60 const QBrush&, bool sunken ) const; 62 61 63 private: 64 QPalette d_palette; 62 private: 63 Q_DISABLE_COPY(QwtDialNeedle) 64 65 QPalette m_palette; 65 66 }; 66 67 67 68 /*! 68 \brief A needle for dial widgets 69 \brief A needle for dial widgets 69 70 70 The following colors are used: 71 The following colors are used: 71 72 72 - QPalette::Mid\n 73 - QPalette::Mid\n 73 74 Pointer 74 - QPalette::Base\n 75 - QPalette::Base\n 75 76 Knob 76 77 77 \sa QwtDial, QwtCompass 78 */ 78 \sa QwtDial, QwtCompass 79 */ 79 80 80 class QWT_EXPORT QwtDialSimpleNeedle: public QwtDialNeedle 81 class QWT_EXPORT QwtDialSimpleNeedle : public QwtDialNeedle 81 82 { 82 public: 83 public: 83 84 //! Style of the needle 84 85 enum Style … … 92 93 93 94 QwtDialSimpleNeedle( Style, bool hasKnob = true, 94 const QColor &mid = Qt::gray, const QColor&base = Qt::darkGray );95 const QColor& mid = Qt::gray, const QColor& base = Qt::darkGray ); 95 96 96 97 void setWidth( double width ); 97 98 double width() const; 98 99 99 protected: 100 virtual void drawNeedle( QPainter *, double length,101 QPalette::ColorGroup ) const; 100 protected: 101 virtual void drawNeedle( QPainter*, double length, 102 QPalette::ColorGroup ) const QWT_OVERRIDE; 102 103 103 private: 104 Style d_style;105 bool d_hasKnob;106 double d_width;104 private: 105 Style m_style; 106 bool m_hasKnob; 107 double m_width; 107 108 }; 108 109 109 110 /*! 110 \brief A magnet needle for compass widgets 111 \brief A magnet needle for compass widgets 111 112 112 A magnet needle points to two opposite directions indicating 113 north and south. 113 A magnet needle points to two opposite directions indicating 114 north and south. 114 115 115 The following colors are used: 116 - QPalette::Light\n 116 The following colors are used: 117 - QPalette::Light\n 117 118 Used for pointing south 118 - QPalette::Dark\n 119 - QPalette::Dark\n 119 120 Used for pointing north 120 - QPalette::Base\n 121 - QPalette::Base\n 121 122 Knob (ThinStyle only) 122 123 123 \sa QwtDial, QwtCompass 124 */ 124 \sa QwtDial, QwtCompass 125 */ 125 126 126 class QWT_EXPORT QwtCompassMagnetNeedle: public QwtDialNeedle 127 class QWT_EXPORT QwtCompassMagnetNeedle : public QwtDialNeedle 127 128 { 128 public: 129 public: 129 130 //! Style of the needle 130 131 enum Style … … 138 139 139 140 QwtCompassMagnetNeedle( Style = TriangleStyle, 140 const QColor &light = Qt::white, const QColor&dark = Qt::red );141 const QColor& light = Qt::white, const QColor& dark = Qt::red ); 141 142 142 protected: 143 virtual void drawNeedle( QPainter *,144 double length, QPalette::ColorGroup ) const; 143 protected: 144 virtual void drawNeedle( QPainter*, 145 double length, QPalette::ColorGroup ) const QWT_OVERRIDE; 145 146 146 private: 147 Style d_style;147 private: 148 Style m_style; 148 149 }; 149 150 150 151 /*! 151 \brief An indicator for the wind direction 152 \brief An indicator for the wind direction 152 153 153 QwtCompassWindArrow shows the direction where the wind comes from. 154 QwtCompassWindArrow shows the direction where the wind comes from. 154 155 155 - QPalette::Light\n 156 - QPalette::Light\n 156 157 Used for Style1, or the light half of Style2 157 - QPalette::Dark\n 158 - QPalette::Dark\n 158 159 Used for the dark half of Style2 159 160 160 \sa QwtDial, QwtCompass 161 */ 161 \sa QwtDial, QwtCompass 162 */ 162 163 163 class QWT_EXPORT QwtCompassWindArrow: public QwtDialNeedle 164 class QWT_EXPORT QwtCompassWindArrow : public QwtDialNeedle 164 165 { 165 public: 166 public: 166 167 //! Style of the arrow 167 168 enum Style … … 174 175 }; 175 176 176 QwtCompassWindArrow( Style, const QColor &light = Qt::white,177 const QColor &dark = Qt::gray );177 QwtCompassWindArrow( Style, const QColor& light = Qt::white, 178 const QColor& dark = Qt::gray ); 178 179 179 protected: 180 virtual void drawNeedle( QPainter *,181 double length, QPalette::ColorGroup ) const; 180 protected: 181 virtual void drawNeedle( QPainter*, 182 double length, QPalette::ColorGroup ) const QWT_OVERRIDE; 182 183 183 private: 184 Style d_style;184 private: 185 Style m_style; 185 186 }; 186 187
Note:
See TracChangeset
for help on using the changeset viewer.
