qwt_wheel.h
Go to the documentation of this file.
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
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 
27 class 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 tf );
82  bool isInverted() const;
83 
84  void setWrapping( bool tf );
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 vmin, double vmax );
97 
98  void setMinimum( double min );
99  double minimum() const;
100 
101  void setMaximum( double max );
102  double maximum() const;
103 
104  void setUpdateInterval( int );
105  int updateInterval() const;
106 
107  void setTracking( bool enable );
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 
135  void wheelPressed();
136 
140  void wheelReleased();
141 
148  void wheelMoved( double value );
149 
150 protected:
151  virtual void paintEvent( QPaintEvent * );
152  virtual void mousePressEvent( QMouseEvent * );
153  virtual void mouseReleaseEvent( QMouseEvent * );
154  virtual void mouseMoveEvent( QMouseEvent * );
155  virtual void keyPressEvent( QKeyEvent * );
156  virtual void wheelEvent( QWheelEvent * );
157  virtual void timerEvent( QTimerEvent * );
158 
159  void stopFlying();
160 
161  QRect wheelRect() const;
162 
163  virtual QSize sizeHint() const;
164  virtual QSize minimumSizeHint() const;
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 *d_data;
177 };
178 
179 #endif
The Wheel Widget.
Definition: qwt_wheel.h:27
#define QWT_EXPORT
Definition: qwt_global.h:38


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:18