#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);
Definition at line 45 of file qwt_analog_clock.h.
Public Types | |
enum | Hand { SecondHand, MinuteHand, HourHand, NHands } |
Public Slots | |
void | setCurrentTime () |
void | setTime (const QTime &=QTime::currentTime()) |
Public Member Functions | |
QwtAnalogClock (QWidget *parent=NULL) | |
virtual | ~QwtAnalogClock () |
virtual void | setHand (Hand, QwtDialNeedle *) |
const QwtDialNeedle * | hand (Hand) const |
QwtDialNeedle * | hand (Hand) |
Protected Member Functions | |
virtual QwtText | scaleLabel (double) const |
virtual void | drawNeedle (QPainter *, const QPoint &, int radius, double direction, QPalette::ColorGroup) const |
virtual void | drawHand (QPainter *, Hand, const QPoint &, int radius, double direction, QPalette::ColorGroup) const |
|
Constructor
Definition at line 16 of file qwt_analog_clock.cpp. References hand(), setHand(), QwtDial::setOrigin(), QwtDoubleRange::setRange(), QwtAbstractSlider::setReadOnly(), QwtDial::setScale(), QwtDial::setScaleOptions(), QwtDial::setScaleTicks(), QwtDialSimpleNeedle::setWidth(), and QwtDial::setWrapping(). |
|
Destructor.
Definition at line 63 of file qwt_analog_clock.cpp. |
|
Draw a clock hand
Definition at line 201 of file qwt_analog_clock.cpp. References QwtDialNeedle::draw(), hand(), and QwtDial::needle(). Referenced by drawNeedle(). |
|
Draw the needle. A clock has no single needle but three hands instead. drawNeedle translates value() into directions for the hands and calls drawHand().
Reimplemented from QwtDial. Definition at line 172 of file qwt_analog_clock.cpp. References drawHand(), QwtAbstractSlider::isValid(), QwtDial::origin(), and QwtDoubleRange::value(). |
|
Definition at line 99 of file qwt_analog_clock.cpp. |
|
Definition at line 112 of file qwt_analog_clock.cpp. Referenced by drawHand(), and QwtAnalogClock(). |
|
Find the scale label for a given value
Reimplemented from QwtDial. Definition at line 149 of file qwt_analog_clock.cpp. |
|
Set the current time. This is the same as QwtAnalogClock::setTime(), but Qt < 3.0 canīt handle default parameters for slots. Definition at line 123 of file qwt_analog_clock.cpp. References setTime(). |
|
Set a clockhand
Definition at line 85 of file qwt_analog_clock.cpp. Referenced by QwtAnalogClock(). |
|
Set a time
Definition at line 132 of file qwt_analog_clock.cpp. References QwtAbstractSlider::setValid(), and QwtAbstractSlider::setValue(). Referenced by setCurrentTime(). |