Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_dial.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_dial.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_dial.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_H 11 #define QWT_DIAL_H 111 #define QWT_DIAL_H 12 12 13 13 #include "qwt_global.h" 14 14 #include "qwt_abstract_slider.h" 15 #include "qwt_abstract_scale_draw.h" 15 16 16 #include <qframe.h> 17 17 #include <qpalette.h> … … 19 19 class QwtDialNeedle; 20 20 class QwtRoundScaleDraw; 21 class QwtAbstractScaleDraw; 21 22 22 23 /*! 23 \brief QwtDial class provides a rounded range control. 24 \brief QwtDial class provides a rounded range control. 24 25 25 QwtDial is intended as base class for dial widgets like 26 speedometers, compass widgets, clocks ... 26 QwtDial is intended as base class for dial widgets like 27 speedometers, compass widgets, clocks ... 27 28 28 \image html dials2.png 29 \image html dials2.png 29 30 30 A dial contains a scale and a needle indicating the current value 31 of the dial. Depending on Mode one of them is fixed and the 32 other is rotating. If not isReadOnly() the 33 dial can be rotated by dragging the mouse or using keyboard inputs 34 (see QwtAbstractSlider::keyPressEvent()). A dial might be wrapping, what means 35 a rotation below/above one limit continues on the other limit (f.e compass). 36 The scale might cover any arc of the dial, its values are related to 37 the origin() of the dial. 31 A dial contains a scale and a needle indicating the current value 32 of the dial. Depending on Mode one of them is fixed and the 33 other is rotating. If not isReadOnly() the 34 dial can be rotated by dragging the mouse or using keyboard inputs 35 (see QwtAbstractSlider::keyPressEvent()). A dial might be wrapping, what means 36 a rotation below/above one limit continues on the other limit (f.e compass). 37 The scale might cover any arc of the dial, its values are related to 38 the origin() of the dial. 38 39 39 Often dials have to be updated very often according to values from external 40 devices. For these high refresh rates QwtDial caches as much as possible. 41 For derived classes it might be necessary to clear these caches manually 42 according to attribute changes using invalidateCache(). 40 Often dials have to be updated very often according to values from external 41 devices. For these high refresh rates QwtDial caches as much as possible. 42 For derived classes it might be necessary to clear these caches manually 43 according to attribute changes using invalidateCache(). 43 44 44 \sa QwtCompass, QwtAnalogClock, QwtDialNeedle 45 \note The controls and dials examples shows different types of dials. 46 \note QDial is more similar to QwtKnob than to QwtDial 47 */ 45 \sa QwtCompass, QwtAnalogClock, QwtDialNeedle 46 \note The controls and dials examples shows different types of dials. 47 \note QDial is more similar to QwtKnob than to QwtDial 48 */ 48 49 49 class QWT_EXPORT QwtDial: public QwtAbstractSlider 50 class QWT_EXPORT QwtDial : public QwtAbstractSlider 50 51 { 51 52 Q_OBJECT … … 60 61 Q_PROPERTY( double maxScaleArc READ maxScaleArc WRITE setMaxScaleArc ) 61 62 62 public: 63 public: 63 64 64 65 /*! … … 92 93 }; 93 94 94 explicit QwtDial( QWidget *parent = NULL );95 explicit QwtDial( QWidget* parent = NULL ); 95 96 virtual ~QwtDial(); 96 97 … … 115 116 double origin() const; 116 117 117 void setNeedle( QwtDialNeedle * );118 const QwtDialNeedle *needle() const;119 QwtDialNeedle *needle();118 void setNeedle( QwtDialNeedle* ); 119 const QwtDialNeedle* needle() const; 120 QwtDialNeedle* needle(); 120 121 121 122 QRect boundingRect() const; … … 124 125 virtual QRect scaleInnerRect() const; 125 126 126 virtual QSize sizeHint() const; 127 virtual QSize minimumSizeHint() const; 127 virtual QSize sizeHint() const QWT_OVERRIDE; 128 virtual QSize minimumSizeHint() const QWT_OVERRIDE; 128 129 129 void setScaleDraw( QwtRoundScaleDraw * );130 void setScaleDraw( QwtRoundScaleDraw* ); 130 131 131 QwtRoundScaleDraw *scaleDraw();132 const QwtRoundScaleDraw *scaleDraw() const;132 QwtRoundScaleDraw* scaleDraw(); 133 const QwtRoundScaleDraw* scaleDraw() const; 133 134 134 protected: 135 virtual void wheelEvent( QWheelEvent * );136 virtual void paintEvent( QPaintEvent * );137 virtual void changeEvent( QEvent * );135 protected: 136 virtual void wheelEvent( QWheelEvent* ) QWT_OVERRIDE; 137 virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE; 138 virtual void changeEvent( QEvent* ) QWT_OVERRIDE; 138 139 139 virtual void drawFrame( QPainter * );140 virtual void drawContents( QPainter * ) const;141 virtual void drawFocusIndicator( QPainter * ) const;140 virtual void drawFrame( QPainter* ); 141 virtual void drawContents( QPainter* ) const; 142 virtual void drawFocusIndicator( QPainter* ) const; 142 143 143 144 void invalidateCache(); 144 145 145 virtual void drawScale( QPainter *,146 const QPointF ¢er, double radius ) const;146 virtual void drawScale( QPainter*, 147 const QPointF& center, double radius ) const; 147 148 148 virtual void drawScaleContents( QPainter *painter,149 const QPointF ¢er, double radius ) const;149 virtual void drawScaleContents( QPainter* painter, 150 const QPointF& center, double radius ) const; 150 151 151 virtual void drawNeedle( QPainter *, const QPointF&,152 virtual void drawNeedle( QPainter*, const QPointF&, 152 153 double radius, double direction, QPalette::ColorGroup ) const; 153 154 154 virtual double scrolledTo( const QPoint & ) const;155 virtual bool isScrollPosition( const QPoint & ) const;155 virtual double scrolledTo( const QPoint& ) const QWT_OVERRIDE; 156 virtual bool isScrollPosition( const QPoint& ) const QWT_OVERRIDE; 156 157 157 virtual void sliderChange(); 158 virtual void scaleChange(); 158 virtual void sliderChange() QWT_OVERRIDE; 159 virtual void scaleChange() QWT_OVERRIDE; 159 160 160 private: 161 private: 161 162 void setAngleRange( double angle, double span ); 162 void drawNeedle( QPainter * ) const;163 void drawNeedle( QPainter* ) const; 163 164 164 165 class PrivateData; 165 PrivateData *d_data;166 PrivateData* m_data; 166 167 }; 167 168
Note:
See TracChangeset
for help on using the changeset viewer.
