Qwt User's Guide 6.3.0
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
10#ifndef QWT_WHEEL_H
11#define QWT_WHEEL_H
12
13#include "qwt_global.h"
14#include <qwidget.h>
15
27class QWT_EXPORT QwtWheel : public QWidget
28{
29 Q_OBJECT
30
31 Q_PROPERTY( Qt::Orientation orientation
32 READ orientation WRITE setOrientation )
33
34 Q_PROPERTY( double value READ value WRITE setValue NOTIFY valueChanged USER true )
35
36 Q_PROPERTY( double minimum READ minimum WRITE setMinimum )
37 Q_PROPERTY( double maximum READ maximum WRITE setMaximum )
38
39 Q_PROPERTY( double singleStep READ singleStep WRITE setSingleStep )
40 Q_PROPERTY( int pageStepCount READ pageStepCount WRITE setPageStepCount )
41 Q_PROPERTY( bool stepAlignment READ stepAlignment WRITE setStepAlignment )
42
43 Q_PROPERTY( bool tracking READ isTracking WRITE setTracking )
44 Q_PROPERTY( bool wrapping READ wrapping WRITE setWrapping )
45 Q_PROPERTY( bool inverted READ isInverted WRITE setInverted )
46
47 Q_PROPERTY( double mass READ mass WRITE setMass )
48 Q_PROPERTY( int updateInterval READ updateInterval WRITE setUpdateInterval )
49
50 Q_PROPERTY( double totalAngle READ totalAngle WRITE setTotalAngle )
51 Q_PROPERTY( double viewAngle READ viewAngle WRITE setViewAngle )
52 Q_PROPERTY( int tickCount READ tickCount WRITE setTickCount )
53 Q_PROPERTY( int wheelWidth READ wheelWidth WRITE setWheelWidth )
54 Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
55 Q_PROPERTY( int wheelBorderWidth READ wheelBorderWidth WRITE setWheelBorderWidth )
56
57 public:
58 explicit QwtWheel( QWidget* parent = NULL );
59 virtual ~QwtWheel();
60
61 double value() const;
62
63 void setOrientation( Qt::Orientation );
64 Qt::Orientation orientation() const;
65
66 double totalAngle() const;
67 double viewAngle() const;
68
69 void setTickCount( int );
70 int tickCount() const;
71
72 void setWheelWidth( int );
73 int wheelWidth() const;
74
75 void setWheelBorderWidth( int );
76 int wheelBorderWidth() const;
77
78 void setBorderWidth( int );
79 int borderWidth() const;
80
81 void setInverted( bool );
82 bool isInverted() const;
83
84 void setWrapping( bool );
85 bool wrapping() const;
86
87 void setSingleStep( double );
88 double singleStep() const;
89
90 void setPageStepCount( int );
91 int pageStepCount() const;
92
93 void setStepAlignment( bool on );
94 bool stepAlignment() const;
95
96 void setRange( double min, double max );
97
98 void setMinimum( double );
99 double minimum() const;
100
101 void setMaximum( double );
102 double maximum() const;
103
104 void setUpdateInterval( int );
105 int updateInterval() const;
106
107 void setTracking( bool );
108 bool isTracking() const;
109
110 double mass() const;
111
112 public Q_SLOTS:
113 void setValue( double );
114 void setTotalAngle ( double );
115 void setViewAngle( double );
116 void setMass( double );
117
118 Q_SIGNALS:
119
129 void valueChanged( double value );
130
136
141
148 void wheelMoved( double value );
149
150 protected:
151 virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
152 virtual void mousePressEvent( QMouseEvent* ) QWT_OVERRIDE;
153 virtual void mouseReleaseEvent( QMouseEvent* ) QWT_OVERRIDE;
154 virtual void mouseMoveEvent( QMouseEvent* ) QWT_OVERRIDE;
155 virtual void keyPressEvent( QKeyEvent* ) QWT_OVERRIDE;
156 virtual void wheelEvent( QWheelEvent* ) QWT_OVERRIDE;
157 virtual void timerEvent( QTimerEvent* ) QWT_OVERRIDE;
158
159 void stopFlying();
160
161 QRect wheelRect() const;
162
163 virtual QSize sizeHint() const QWT_OVERRIDE;
164 virtual QSize minimumSizeHint() const QWT_OVERRIDE;
165
166 virtual void drawTicks( QPainter*, const QRectF& );
167 virtual void drawWheelBackground( QPainter*, const QRectF& );
168
169 virtual double valueAt( const QPoint& ) const;
170
171 private:
172 double alignedValue( double ) const;
173 double boundedValue( double ) const;
174
175 class PrivateData;
176 PrivateData* m_data;
177};
178
179#endif
The Wheel Widget.
Definition qwt_wheel.h:28
void wheelMoved(double value)
void wheelReleased()
void wheelPressed()
void valueChanged(double value)
Notify a change of value.