58 #ifndef ACG_QT_WHEEL_HH
59 #define ACG_QT_WHEEL_HH
66 #include <QMouseEvent>
69 #include <QResizeEvent>
70 #include <QPaintEvent>
72 #include "../Config/ACGDefines.hh"
122 Orientation _orientation = Horizontal);
133 int ticks()
const {
return ticks_; }
136 ticks_=_number; redrawPixmap(); repaint();
140 double angle()
const {
return angle_; }
143 angle_=_angle; lastAngle_=0.0; redrawPixmap(); repaint();
156 marker_=_b; redrawPixmap(); repaint();
160 Orientation orientation()
const;
163 orientation_=_orientation; redrawPixmap(); repaint();
188 double gear()
const {
return gear_; }
191 virtual QSizePolicy sizePolicy()
const;
193 virtual QSize sizeHint()
const;
203 static double clip(
double _angle);
206 static double deg(
double _angle);
212 void angleChangedTo(
double _angle);
223 void angleChangedBy(
double _angle);
238 virtual void mousePressEvent(QMouseEvent*);
240 virtual void mouseReleaseEvent(QMouseEvent*);
242 virtual void mouseMoveEvent(QMouseEvent*);
244 virtual void mouseDoubleClickEvent(QMouseEvent*);
246 virtual void keyPressEvent(QKeyEvent*);
248 virtual void keyReleaseEvent(QKeyEvent*);
251 virtual void resizeEvent(QResizeEvent*);
253 virtual void paintEvent(QPaintEvent*);
259 virtual void redrawPixmap();
262 void slotCustomContextMenuRequested (
const QPoint & pos );
272 double turn(
const QPoint& _pos);
274 void shrinkRect(QRect&,
int,
int);
300 #endif // ACG_QWHEEL_HH defined
double gear() const
How fast does angle() change when the wheel is turned? (see above)
void setMarker(bool _b)
enable/disable markers on the wheel
Orientation orientation_
orientation of the widget
Namespace providing different geometric functions concerning angles.
void setOrientation(Orientation _orientation)
set orientation
int ticks_
number of ticks on the wheel
bool tracking_
tracking on?
int gearShift_
click-shifted gear by 2^gearShift_
void setTracking(bool _b)
bool draggingWheel() const
Is the user currently dragging the wheel whith the mouse?
double angle() const
get current angle of the wheel (radiants, unbounded, cf. clip())
void setTicks(int _number)
set _number of ticks on the wheel (default: 36)
bool dragging_
currently dragging the slider?
void setAngle(double _angle)
set current angle of the wheel (radiants, unbounded, cf. clip())
bool tracking() const
Is tracking on?
bool marker_
should ticks be marked by colors?
double angle_
current angle of the wheel
bool marker() const
Are there markers on the wheel?
QPixmap pixmap_
pixmap of the wheel
QPalette palette_
color group
virtual void drawContents(QPainter *)
reimplemented
QPoint pos_
recent mouse position
double lastAngle_
last angle, depends on tracking_
Orientation
Orientation of the widget.
double gear_
speed of revolution
int size_
size of wheel in pixels
int ticks() const
get number of ticks on the wheel