52 #ifndef ACG_QT_WHEEL_HH 53 #define ACG_QT_WHEEL_HH 60 #include <QMouseEvent> 63 #include <QResizeEvent> 64 #include <QPaintEvent> 66 #include "../Config/ACGDefines.hh" 127 int ticks()
const {
return ticks_; }
130 ticks_=_number; redrawPixmap(); repaint();
134 double angle()
const {
return angle_; }
137 angle_=_angle; lastAngle_=0.0; redrawPixmap(); repaint();
150 marker_=_b; redrawPixmap(); repaint();
157 orientation_=_orientation; redrawPixmap(); repaint();
182 double gear()
const {
return gear_; }
185 virtual QSizePolicy sizePolicy()
const;
187 virtual QSize sizeHint()
const;
197 static double clip(
double _angle);
200 static double deg(
double _angle);
206 void angleChangedTo(
double _angle);
217 void angleChangedBy(
double _angle);
232 virtual void mousePressEvent(QMouseEvent*);
234 virtual void mouseReleaseEvent(QMouseEvent*);
236 virtual void mouseMoveEvent(QMouseEvent*);
238 virtual void mouseDoubleClickEvent(QMouseEvent*);
240 virtual void keyPressEvent(QKeyEvent*);
242 virtual void keyReleaseEvent(QKeyEvent*);
245 virtual void resizeEvent(QResizeEvent*);
247 virtual void paintEvent(QPaintEvent*);
253 virtual void redrawPixmap();
256 void slotCustomContextMenuRequested (
const QPoint & pos );
266 double turn(
const QPoint& _pos);
268 void shrinkRect(QRect&,
int,
int);
294 #endif // ACG_QWHEEL_HH defined Namespace providing different geometric functions concerning angles.
int gearShift_
click-shifted gear by 2^gearShift_
bool draggingWheel() const
Is the user currently dragging the wheel whith the mouse?
int ticks_
number of ticks on the wheel
void setTicks(int _number)
set _number of ticks on the wheel (default: 36)
virtual void drawContents(QPainter *)
reimplemented
QPoint pos_
recent mouse position
double angle_
current angle of the wheel
void setMarker(bool _b)
enable/disable markers on the wheel
double gear() const
How fast does angle() change when the wheel is turned? (see above)
Orientation orientation_
orientation of the widget
bool tracking_
tracking on?
void setTracking(bool _b)
bool dragging_
currently dragging the slider?
bool marker_
should ticks be marked by colors?
void setOrientation(Orientation _orientation)
set orientation
QPixmap pixmap_
pixmap of the wheel
void setAngle(double _angle)
set current angle of the wheel (radiants, unbounded, cf. clip())
int ticks() const
get number of ticks on the wheel
double gear_
speed of revolution
bool tracking() const
Is tracking on?
double lastAngle_
last angle, depends on tracking_
Orientation
Orientation of the widget.
bool marker() const
Are there markers on the wheel?
QPalette palette_
color group
int size_
size of wheel in pixels
double angle() const
get current angle of the wheel (radiants, unbounded, cf. clip())