QWT 7.0.1
Loading...
Searching...
No Matches
qwt_wheel.h
1/******************************************************************************
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 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_WHEEL_H
28#define QWT_WHEEL_H
29
30#include "qwt_global.h"
31#include <qwidget.h>
32
44class QWT_EXPORT QwtWheel : public QWidget
45{
46 Q_OBJECT
47
48 Q_PROPERTY( Qt::Orientation orientation
49 READ orientation WRITE setOrientation )
50
51 Q_PROPERTY( double value READ value WRITE setValue NOTIFY valueChanged USER true )
52
53 Q_PROPERTY( double minimum READ minimum WRITE setMinimum )
54 Q_PROPERTY( double maximum READ maximum WRITE setMaximum )
55
56 Q_PROPERTY( double singleStep READ singleStep WRITE setSingleStep )
57 Q_PROPERTY( int pageStepCount READ pageStepCount WRITE setPageStepCount )
58 Q_PROPERTY( bool stepAlignment READ stepAlignment WRITE setStepAlignment )
59
60 Q_PROPERTY( bool tracking READ isTracking WRITE setTracking )
61 Q_PROPERTY( bool wrapping READ wrapping WRITE setWrapping )
62 Q_PROPERTY( bool inverted READ isInverted WRITE setInverted )
63
64 Q_PROPERTY( double mass READ mass WRITE setMass )
65 Q_PROPERTY( int updateInterval READ updateInterval WRITE setUpdateInterval )
66
67 Q_PROPERTY( double totalAngle READ totalAngle WRITE setTotalAngle )
68 Q_PROPERTY( double viewAngle READ viewAngle WRITE setViewAngle )
69 Q_PROPERTY( int tickCount READ tickCount WRITE setTickCount )
70 Q_PROPERTY( int wheelWidth READ wheelWidth WRITE setWheelWidth )
71 Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
72 Q_PROPERTY( int wheelBorderWidth READ wheelBorderWidth WRITE setWheelBorderWidth )
73
74 public:
75 explicit QwtWheel( QWidget* parent = NULL );
76 virtual ~QwtWheel();
77
78 double value() const;
79
80 void setOrientation( Qt::Orientation );
81 Qt::Orientation orientation() const;
82
83 double totalAngle() const;
84 double viewAngle() const;
85
86 void setTickCount( int );
87 int tickCount() const;
88
89 void setWheelWidth( int );
90 int wheelWidth() const;
91
92 void setWheelBorderWidth( int );
93 int wheelBorderWidth() const;
94
95 void setBorderWidth( int );
96 int borderWidth() const;
97
98 void setInverted( bool );
99 bool isInverted() const;
100
101 void setWrapping( bool );
102 bool wrapping() const;
103
104 void setSingleStep( double );
105 double singleStep() const;
106
107 void setPageStepCount( int );
108 int pageStepCount() const;
109
110 void setStepAlignment( bool on );
111 bool stepAlignment() const;
112
113 void setRange( double min, double max );
114
115 void setMinimum( double );
116 double minimum() const;
117
118 void setMaximum( double );
119 double maximum() const;
120
121 void setUpdateInterval( int );
122 int updateInterval() const;
123
124 void setTracking( bool );
125 bool isTracking() const;
126
127 double mass() const;
128
129 public Q_SLOTS:
130 void setValue( double );
131 void setTotalAngle ( double );
132 void setViewAngle( double );
133 void setMass( double );
134
135 Q_SIGNALS:
136
146 void valueChanged( double value );
147
153
158
165 void wheelMoved( double value );
166
167 protected:
168 virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
169 virtual void mousePressEvent( QMouseEvent* ) QWT_OVERRIDE;
170 virtual void mouseReleaseEvent( QMouseEvent* ) QWT_OVERRIDE;
171 virtual void mouseMoveEvent( QMouseEvent* ) QWT_OVERRIDE;
172 virtual void keyPressEvent( QKeyEvent* ) QWT_OVERRIDE;
173 virtual void wheelEvent( QWheelEvent* ) QWT_OVERRIDE;
174 virtual void timerEvent( QTimerEvent* ) QWT_OVERRIDE;
175
176 void stopFlying();
177
178 QRect wheelRect() const;
179
180 virtual QSize sizeHint() const QWT_OVERRIDE;
181 virtual QSize minimumSizeHint() const QWT_OVERRIDE;
182
183 virtual void drawTicks( QPainter*, const QRectF& );
184 virtual void drawWheelBackground( QPainter*, const QRectF& );
185
186 virtual double valueAt( const QPoint& ) const;
187
188 private:
189 double alignedValue( double ) const;
190 double boundedValue( double ) const;
191
192 class PrivateData;
193 PrivateData* m_data;
194};
195
196#endif
The Wheel Widget.
Definition qwt_wheel.h:45
void wheelMoved(double value)
This signal is emitted when the user moves the wheel with the mouse.
void wheelReleased()
This signal is emitted when the user releases the mouse.
void wheelPressed()
This signal is emitted when the user presses the the wheel with the mouse.
void valueChanged(double value)
Notify a change of value.