|
Eneboo - Documentación para desarrolladores
|
An analog clock. Más...
#include <qwt_analog_clock.h>
Tipos públicos | |
| enum | Hand { SecondHand, MinuteHand, HourHand, NHands } |
Slots públicos | |
| void | setCurrentTime () |
| Set the current time. | |
| void | setTime (const QTime &=QTime::currentTime()) |
Métodos públicos | |
| QwtAnalogClock (QWidget *parent=NULL) | |
| QwtAnalogClock (QWidget *parent, const char *name) | |
| virtual | ~QwtAnalogClock () |
| Destructor. | |
| virtual void | setHand (Hand, QwtDialNeedle *) |
| const QwtDialNeedle * | hand (Hand) const |
| QwtDialNeedle * | hand (Hand) |
Métodos protegidos | |
| virtual QwtText | scaleLabel (double) const |
| virtual void | drawNeedle (QPainter *, const QPoint &, int radius, double direction, QPalette::ColorGroup) const |
| Draw the needle. | |
| virtual void | drawHand (QPainter *, Hand, const QPoint &, int radius, double direction, QPalette::ColorGroup) const |
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 |
Constructor
| parent | Parent widget |
| QwtAnalogClock::QwtAnalogClock | ( | QWidget * | parent, |
| const char * | name | ||
| ) | [explicit] |
Constructor
| parent | Parent widget |
| name | Object name |
| QwtAnalogClock::~QwtAnalogClock | ( | ) | [virtual] |
Destructor.
| void QwtAnalogClock::drawHand | ( | QPainter * | painter, |
| Hand | hd, | ||
| const QPoint & | center, | ||
| int | radius, | ||
| double | direction, | ||
| QPalette::ColorGroup | cg | ||
| ) | const [protected, virtual] |
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 |
| void QwtAnalogClock::drawNeedle | ( | QPainter * | painter, |
| const QPoint & | center, | ||
| int | radius, | ||
| double | direction, | ||
| QPalette::ColorGroup | cg | ||
| ) | const [protected, virtual] |
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 |
| direction | Dummy, not used. |
| cg | ColorGroup |
Reimplementado de QwtDial.
| QwtDialNeedle * QwtAnalogClock::hand | ( | Hand | hd | ) |
| const QwtDialNeedle * QwtAnalogClock::hand | ( | Hand | hd | ) | const |
| QwtText QwtAnalogClock::scaleLabel | ( | double | value | ) | const [protected, virtual] |
| void QwtAnalogClock::setCurrentTime | ( | ) | [slot] |
Set the current time.
This is the same as QwtAnalogClock::setTime(), but Qt < 3.0 can't handle default parameters for slots.
| void QwtAnalogClock::setHand | ( | Hand | hand, |
| QwtDialNeedle * | needle | ||
| ) | [virtual] |
Set a clockhand
| hand | Specifies the type of hand |
| needle | Hand |
| void QwtAnalogClock::setTime | ( | const QTime & | time = QTime::currentTime() | ) | [slot] |
Set a time
| time | Time to display |
1.7.4