|
Qwt User's Guide
6.0.2
|
#include <qwt_analog_clock.h>

Public Types | |
| enum | Hand { SecondHand, MinuteHand, HourHand, NHands } |
Public Types inherited from QwtDial | |
| enum | Direction { Clockwise, CounterClockwise } |
| enum | Mode { RotateNeedle, RotateScale } |
| enum | Shadow { Plain = QFrame::Plain, Raised = QFrame::Raised, Sunken = QFrame::Sunken } |
Public Types inherited from QwtAbstractSlider | |
| enum | ScrollMode { ScrNone, ScrMouse, ScrTimer, ScrDirect, ScrPage } |
Public Slots | |
| void | setCurrentTime () |
| void | setTime (const QTime &=QTime::currentTime()) |
Public Member Functions | |
| QwtAnalogClock (QWidget *parent=NULL) | |
| virtual | ~QwtAnalogClock () |
| const QwtDialNeedle * | hand (Hand) const |
| QwtDialNeedle * | hand (Hand) |
| virtual void | setHand (Hand, QwtDialNeedle *) |
Public Member Functions inherited from QwtDial | |
| QwtDial (QWidget *parent=NULL) | |
| virtual | ~QwtDial () |
| QRectF | boundingRect () const |
| Direction | direction () const |
| Shadow | frameShadow () const |
| QRectF | innerRect () const |
| int | lineWidth () const |
| double | maxScaleArc () const |
| virtual QSize | minimumSizeHint () const |
| double | minScaleArc () const |
| Mode | mode () const |
| const QwtDialNeedle * | needle () const |
| QwtDialNeedle * | needle () |
| double | origin () const |
| QwtDialScaleDraw * | scaleDraw () |
| const QwtDialScaleDraw * | scaleDraw () const |
| virtual QRectF | scaleInnerRect () const |
| void | setDirection (Direction) |
| void | setFrameShadow (Shadow) |
| void | setLineWidth (int) |
| void | setMode (Mode) |
| virtual void | setOrigin (double) |
| virtual void | setScale (int maxMajIntv, int maxMinIntv, double step=0.0) |
| void | setScaleArc (double min, double max) |
| void | setScaleComponents (QwtAbstractScaleDraw::ScaleComponents) |
| virtual void | setScaleDraw (QwtDialScaleDraw *) |
| void | setScaleTicks (int minLen, int medLen, int majLen, int penWidth=1) |
| virtual void | setWrapping (bool) |
| virtual QSize | sizeHint () const |
| bool | wrapping () const |
Public Member Functions inherited from QwtAbstractSlider | |
| QwtAbstractSlider (Qt::Orientation, QWidget *parent=NULL) | |
| virtual | ~QwtAbstractSlider () |
| bool | isReadOnly () const |
| bool | isValid () const |
| virtual double | mass () const |
| Qt::Orientation | orientation () const |
| virtual void | setMass (double val) |
| virtual void | setOrientation (Qt::Orientation o) |
| void | setTracking (bool enable) |
| void | setUpdateTime (int t) |
| void | setValid (bool valid) |
| void | stopMoving () |
Public Member Functions inherited from QwtDoubleRange | |
| QwtDoubleRange () | |
| virtual | ~QwtDoubleRange () |
| virtual void | incPages (int) |
| double | maxValue () const |
| double | minValue () const |
| int | pageSize () const |
| bool | periodic () const |
| void | setPeriodic (bool tf) |
| void | setRange (double vmin, double vmax, double vstep=0.0, int pagesize=1) |
| void | setStep (double) |
| double | step () const |
| double | value () const |
Protected Member Functions | |
| virtual void | drawHand (QPainter *, Hand, const QPointF &, double radius, double direction, QPalette::ColorGroup) const |
| virtual void | drawNeedle (QPainter *, const QPointF &, double radius, double direction, QPalette::ColorGroup) const |
| virtual QwtText | scaleLabel (double) const |
Protected Member Functions inherited from QwtDial | |
| virtual void | drawContents (QPainter *) const |
| virtual void | drawFocusIndicator (QPainter *) const |
| virtual void | drawFrame (QPainter *p) |
| virtual void | drawScale (QPainter *, const QPointF ¢er, double radius, double origin, double arcMin, double arcMax) const |
| virtual void | drawScaleContents (QPainter *painter, const QPointF ¢er, double radius) const |
| virtual void | getScrollMode (const QPoint &, QwtAbstractSlider::ScrollMode &, int &direction) const |
| virtual double | getValue (const QPoint &) |
| virtual void | keyPressEvent (QKeyEvent *) |
| virtual void | paintEvent (QPaintEvent *) |
| virtual void | rangeChange () |
| void | updateScale () |
| virtual void | valueChange () |
Protected Member Functions inherited from QwtAbstractSlider | |
| virtual void | mouseMoveEvent (QMouseEvent *e) |
| double | mouseOffset () const |
| virtual void | mousePressEvent (QMouseEvent *e) |
| virtual void | mouseReleaseEvent (QMouseEvent *e) |
| int | scrollMode () const |
| void | setMouseOffset (double) |
| virtual void | setPosition (const QPoint &) |
| virtual void | timerEvent (QTimerEvent *e) |
| virtual void | wheelEvent (QWheelEvent *e) |
Protected Member Functions inherited from QwtDoubleRange | |
| double | exactPrevValue () const |
| double | exactValue () const |
| double | prevValue () const |
| virtual void | stepChange () |
An analog clock.
#include <qwt_analog_clock.h> QwtAnalogClock *clock = new QwtAnalogClock(...); clock->scaleDraw()->setPenWidth(3); clock->setLineWidth(6); clock->setFrameShadow(QwtDial::Sunken); clock->setTime(); // update the clock every second QTimer *timer = new QTimer(clock); timer->connect(timer, SIGNAL(timeout()), clock, SLOT(setCurrentTime())); timer->start(1000);
Qwt is missing a set of good looking hands. Contributions are very welcome.
| enum QwtAnalogClock::Hand |
|
explicit |
Constructor
| parent | Parent widget |
|
protectedvirtual |
Draw a clock hand
| painter | Painter |
| hd | Specify the type of hand |
| center | Center of the clock |
| radius | Maximum length for the hands |
| direction | Direction of the hand in degrees, counter clockwise |
| cg | ColorGroup |
|
protectedvirtual |
Draw the needle.
A clock has no single needle but three hands instead. drawNeedle translates value() into directions for the hands and calls drawHand().
| painter | Painter |
| center | Center of the clock |
| radius | Maximum length for the hands |
| dir | Dummy, not used. |
| colorGroup | ColorGroup |
Reimplemented from QwtDial.
| const QwtDialNeedle * QwtAnalogClock::hand | ( | Hand | hd | ) | const |
| QwtDialNeedle * QwtAnalogClock::hand | ( | Hand | hd | ) |
|
protectedvirtual |
Find the scale label for a given value
| value | Value |
Reimplemented from QwtDial.
|
slot |
Set the current time.
This is the same as QwtAnalogClock::setTime(), but Qt < 3.0 can't handle default parameters for slots.
|
virtual |
|
slot |
Set a time
| time | Time to display |
1.8.1