Inherits QwtDial.
An analog clock.
Example.RS 4
#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.
Note:
Definition at line 45 of file qwt_analog_clock.h.
enum Hand { SecondHand, MinuteHand, HourHand, NHands }
void setCurrentTime ()
void setTime (const QTime &=QTime::currentTime())
QwtAnalogClock (QWidget *parent=0, const char *name=0)
virtual ~QwtAnalogClock ()
virtual void setHand (Hand, QwtDialNeedle *)
const QwtDialNeedle * hand (Hand) const
QwtDialNeedle * hand (Hand)
virtual QString 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
Parameters:
Definition at line 8 of file qwt_analog_clock.cpp.
References hand(), setHand(), QwtDial::setOrigin(), QwtDblRange::setRange(), QwtSliderBase::setReadOnly(), QwtDial::setScale(), QwtDial::setScaleOptions(), QwtDial::setScaleTicks(), QwtDialSimpleNeedle::setWidth(), and QwtDial::setWrapping().
Destructor.
Definition at line 50 of file qwt_analog_clock.cpp.
Draw a clock hand
Parameters:
Definition at line 191 of file qwt_analog_clock.cpp.
References QwtDialNeedle::draw(), and hand().
Draw the needle.
A clock has no single needle but three hands instead. drawNeedle translates value() into directions for the hands and calls drawHand().
Parameters:
See also:
Reimplemented from QwtDial.
Definition at line 162 of file qwt_analog_clock.cpp.
References drawHand(), QwtSliderBase::isValid(), QwtDial::origin(), and QwtDblRange::value().
Returns:
Parameters:
See also:
Definition at line 86 of file qwt_analog_clock.cpp.
Returns:
Parameters:
See also:
Definition at line 99 of file qwt_analog_clock.cpp.
Referenced by drawHand(), and QwtAnalogClock().
Find the scale label for a given value
Parameters:
Returns:
Reimplemented from QwtDial.
Definition at line 136 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 110 of file qwt_analog_clock.cpp.
Set a clockhand
Parameters:
See also:
Definition at line 72 of file qwt_analog_clock.cpp.
Referenced by QwtAnalogClock().
Set a time
Parameters:
Definition at line 119 of file qwt_analog_clock.cpp.
References QwtSliderBase::setValid(), and QwtSliderBase::setValue().
Referenced by setCurrentTime().
Generated automatically by Doxygen for Qwt User's Guide from the source code.