QwtAnalogClock(3) | Qwt User's Guide | QwtAnalogClock(3) |
NAME
QwtAnalogClock - An analog clock.
SYNOPSIS
#include <qwt_analog_clock.h>
Inherits QwtDial.
Public Types
enum Hand { SecondHand, MinuteHand,
HourHand, NHands }
Public Slots
void setCurrentTime ()
Set the current time. void setTime (const QTime &)
Public Member Functions
QwtAnalogClock (QWidget *parent=NULL)
virtual ~QwtAnalogClock ()
Destructor. void setHand (Hand, QwtDialNeedle *)
const QwtDialNeedle * hand (Hand) const
QwtDialNeedle * hand (Hand)
Protected Member Functions
virtual void drawNeedle (QPainter *, const QPointF &,
double radius, double direction, QPalette::ColorGroup) const override
Draw the needle. virtual void drawHand (QPainter *, Hand, const
QPointF &, double radius, double direction, QPalette::ColorGroup) const
Additional Inherited Members
Detailed Description
An analog clock.
Example
#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);
Note
Definition at line 43 of file qwt_analog_clock.h.
Member Enumeration Documentation
enum QwtAnalogClock::Hand
Hand type
See also
Enumerator
- SecondHand
- Needle displaying the seconds.
- MinuteHand
- Needle displaying the minutes.
- HourHand
- Needle displaying the hours.
- NHands
- Number of needles.
Definition at line 52 of file qwt_analog_clock.h.
Constructor & Destructor Documentation
QwtAnalogClock::QwtAnalogClock (QWidget * parent = NULL) [explicit]
Constructor
Parameters
Definition at line 51 of file qwt_analog_clock.cpp.
Member Function Documentation
void QwtAnalogClock::drawHand (QPainter * painter, Hand hd, const QPointF & center, double radius, double direction, QPalette::ColorGroup cg) const [protected], [virtual]
Draw a clock hand
Parameters
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
Definition at line 239 of file qwt_analog_clock.cpp.
void QwtAnalogClock::drawNeedle (QPainter * painter, const QPointF & center, double radius, double direction, QPalette::ColorGroup colorGroup) const [override], [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().
Parameters
center Center of the clock
radius Maximum length for the hands
direction Dummy, not used.
colorGroup ColorGroup
See also
Reimplemented from QwtDial.
Definition at line 202 of file qwt_analog_clock.cpp.
QwtDialNeedle * QwtAnalogClock::hand (Hand hd)
Returns
Parameters
See also
Definition at line 146 of file qwt_analog_clock.cpp.
const QwtDialNeedle * QwtAnalogClock::hand (Hand hd) const
Returns
Parameters
See also
Definition at line 159 of file qwt_analog_clock.cpp.
void QwtAnalogClock::setHand (Hand hand, QwtDialNeedle * needle)
Set a clock hand
Parameters
needle Hand
See also
Definition at line 132 of file qwt_analog_clock.cpp.
void QwtAnalogClock::setTime (const QTime & time) [slot]
Set a time
Parameters
Definition at line 176 of file qwt_analog_clock.cpp.
Author
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Sun Jul 18 2021 | Version 6.2.0 |