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