Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_counter.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (4 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_counter.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_counter.h
r9383 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 15 15 16 16 /*! 17 \brief The Counter Widget 17 \brief The Counter Widget 18 18 19 A Counter consists of a label displaying a number and 20 one ore more (up to three) push buttons on each side 21 of the label which can be used to increment or decrement 22 the counter's value. 19 A Counter consists of a label displaying a number and 20 one ore more (up to three) push buttons on each side 21 of the label which can be used to increment or decrement 22 the counter's value. 23 23 24 A counter has a range from a minimum value to a maximum value 25 and a step size. When the wrapping property is set 26 the counter is circular. 24 A counter has a range from a minimum value to a maximum value 25 and a step size. When the wrapping property is set 26 the counter is circular. 27 27 28 The number of steps by which a button increments or decrements the value 29 can be specified using setIncSteps(). The number of buttons can be 30 changed with setNumButtons(). 28 The number of steps by which a button increments or decrements the value 29 can be specified using setIncSteps(). The number of buttons can be 30 changed with setNumButtons(). 31 31 32 Example: 33 \code 34 #include <qwt_counter.h> 32 Example: 33 \code 34 #include <qwt_counter.h> 35 35 36 QwtCounter *counter = new QwtCounter(parent); 36 QwtCounter *counter = new QwtCounter(parent); 37 37 38 counter->setRange(0.0, 100.0); // From 0.0 to 100 39 counter->setSingleStep( 1.0 ); // Step size 1.0 40 counter->setNumButtons(2); // Two buttons each side 41 counter->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 step 42 counter->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 steps 38 counter->setRange(0.0, 100.0); // From 0.0 to 100 39 counter->setSingleStep( 1.0 ); // Step size 1.0 40 counter->setNumButtons(2); // Two buttons each side 41 counter->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 step 42 counter->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 steps 43 43 44 connect(counter, SIGNAL(valueChanged(double)), myClass, SLOT(newValue(double))); 45 \endcode 44 connect(counter, SIGNAL(valueChanged(double)), myClass, SLOT(newValue(double))); 45 \endcode 46 46 */ 47 47 … … 50 50 Q_OBJECT 51 51 52 Q_PROPERTY( double value READ value WRITE setValue ) 52 Q_PROPERTY( double value READ value WRITE setValue NOTIFY valueChanged USER true ) 53 53 Q_PROPERTY( double minimum READ minimum WRITE setMinimum ) 54 54 Q_PROPERTY( double maximum READ maximum WRITE setMaximum ) … … 63 63 Q_PROPERTY( bool wrapping READ wrapping WRITE setWrapping ) 64 64 65 public: 65 public: 66 66 //! Button index 67 67 enum Button … … 80 80 }; 81 81 82 explicit QwtCounter( QWidget *parent = NULL );82 explicit QwtCounter( QWidget* parent = NULL ); 83 83 virtual ~QwtCounter(); 84 84 … … 98 98 int incSteps( QwtCounter::Button ) const; 99 99 100 virtual QSize sizeHint() const; 100 virtual QSize sizeHint() const QWT_OVERRIDE; 101 101 102 102 double singleStep() const; … … 122 122 double value() const; 123 123 124 public Q_SLOTS: 124 public Q_SLOTS: 125 125 void setValue( double ); 126 126 127 127 128 Q_SIGNALS: 128 Q_SIGNALS: 129 129 /*! 130 130 This signal is emitted when a button has been released 131 131 \param value The new value 132 */ 132 */ 133 133 void buttonReleased ( double value ); 134 134 … … 136 136 This signal is emitted when the counter's value has changed 137 137 \param value The new value 138 */ 138 */ 139 139 void valueChanged ( double value ); 140 140 141 protected: 142 virtual bool event( QEvent * );143 virtual void wheelEvent( QWheelEvent * );144 virtual void keyPressEvent( QKeyEvent * );141 protected: 142 virtual bool event( QEvent* ) QWT_OVERRIDE; 143 virtual void wheelEvent( QWheelEvent* ) QWT_OVERRIDE; 144 virtual void keyPressEvent( QKeyEvent* ) QWT_OVERRIDE; 145 145 146 private Q_SLOTS: 146 private Q_SLOTS: 147 147 void btnReleased(); 148 148 void btnClicked(); 149 149 void textChanged(); 150 150 151 private: 151 private: 152 152 void incrementValue( int numSteps ); 153 153 void initCounter(); … … 156 156 157 157 class PrivateData; 158 PrivateData *d_data;158 PrivateData* m_data; 159 159 }; 160 160
Note:
See TracChangeset
for help on using the changeset viewer.
