Qwt User's Guide 6.0.2

- Main Page
- Related Pages
- Classes

qwt_wheel.h
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 "qwt_abstract_slider.h"
15
25 class QWT_EXPORT QwtWheel : public QwtAbstractSlider
26 {
27 Q_OBJECT
28
29 Q_PROPERTY( double totalAngle READ totalAngle WRITE setTotalAngle )
30 Q_PROPERTY( double viewAngle READ viewAngle WRITE setViewAngle )
31 Q_PROPERTY( int tickCnt READ tickCnt WRITE setTickCnt )
32 Q_PROPERTY( int wheelWidth READ wheelWidth WRITE setWheelWidth )
33 Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
34 Q_PROPERTY( int wheelBorderWidth READ wheelBorderWidth WRITE setWheelBorderWidth )
35 Q_PROPERTY( double mass READ mass WRITE setMass )
36
37 public:
38 explicit QwtWheel( QWidget *parent = NULL );
39 virtual ~QwtWheel();
40
41 public Q_SLOTS:
42 void setTotalAngle ( double );
43 void setViewAngle( double );
44
45 public:
46 virtual void setOrientation( Qt::Orientation );
47
48 double totalAngle() const;
49 double viewAngle() const;
50
51 void setTickCnt( int );
52 int tickCnt() const;
53
54 void setMass( double );
55 double mass() const;
56
57 void setWheelWidth( int );
58 int wheelWidth() const;
59
60 void setWheelBorderWidth( int );
61 int wheelBorderWidth() const;
62
63 void setBorderWidth( int );
64 int borderWidth() const;
65
66 QRect wheelRect() const;
67
68 virtual QSize sizeHint() const;
69 virtual QSize minimumSizeHint() const;
70
71 protected:
72 virtual void paintEvent( QPaintEvent * );
73 virtual void resizeEvent( QResizeEvent * );
74
75 virtual void drawTicks( QPainter *, const QRectF & );
76 virtual void drawWheelBackground( QPainter *, const QRectF & );
77
78 virtual void valueChange();
79
80 virtual double getValue( const QPoint & );
81 virtual void getScrollMode( const QPoint &,
82 QwtAbstractSlider::ScrollMode &, int &direction ) const;
83
84 private:
85 class PrivateData;
86 PrivateData *d_data;
87 };
88
89 #endif