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
int ticks() const
get number of ticks on the wheel
double gear() const
How fast does angle() change when the wheel is turned? (see above)
Namespace providing different geometric functions concerning angles.
void setAngle(double _angle)
set current angle of the wheel (radiants, unbounded, cf. clip())
bool tracking() const
Is tracking on?
bool marker() const
Are there markers on the wheel?
double angle_
current angle of the wheel
QPixmap pixmap_
pixmap of the wheel
int ticks_
number of ticks on the wheel
int gearShift_
click-shifted gear by 2^gearShift_
bool draggingWheel() const
Is the user currently dragging the wheel whith the mouse?
double gear_
speed of revolution
int size_
size of wheel in pixels
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)
void setMarker(bool _b)
enable/disable markers on the wheel
bool dragging_
currently dragging the slider?
QPalette palette_
color group
Orientation orientation_
orientation of the widget
bool marker_
should ticks be marked by colors?
void setOrientation(Orientation _orientation)
set orientation
virtual void drawContents(QPainter *)
reimplemented
bool tracking_
tracking on?
QPoint pos_
recent mouse position
double lastAngle_
last angle, depends on tracking_
void setTracking(bool _b)
Orientation
Orientation of the widget.