QwtAnalogClock - An analog clock.
Contents
Constructor & Destructor Documentation
QwtAnalogClock::QwtAnalogClock(QWidget*parent=NULL)[explicit]
Constructor
Parameters:parent Parent widget
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:
The examples/dials example shows how to use QwtAnalogClock.
Member Enumeration Documentation
enumQwtAnalogClock::Hand
Hand type
Seealso:setHand(), hand()EnumeratorSecondHand
Needle displaying the seconds.
MinuteHand
Needle displaying the minutes.
HourHand
Needle displaying the hours.
NHands Number of needles.
Member Function Documentation
voidQwtAnalogClock::drawHand(QPainter*painter,Handhd,constQPointF¢er,doubleradius,doubledirection,QPalette::ColorGroupcg)const[protected],[virtual]
Draw a clock hand
Parameters: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
voidQwtAnalogClock::drawNeedle(QPainter*painter,constQPointF¢er,doubleradius,doubledir,QPalette::ColorGroupcolorGroup)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().
Parameters:painter Painter
center Center of the clock
radius Maximum length for the hands
dir Dummy, not used.
colorGroup ColorGroup
Seealso:drawHand()
Reimplemented from QwtDial.
constQwtDialNeedle*QwtAnalogClock::hand(Handhd)constReturns:
Clock hand
Parameters:hd Specifies the type of hand
Seealso:setHand()QwtDialNeedle*QwtAnalogClock::hand(Handhd)Returns:
Clock hand
Parameters:hd Specifies the type of hand
Seealso:setHand()voidQwtAnalogClock::setHand(Handhand,QwtDialNeedle*needle)
Set a clock hand
Parameters:hand Specifies the type of hand
needle Hand
Seealso:hand()voidQwtAnalogClock::setTime(constQTime&time)[slot]
Set a time
Parameters:time Time to display
Name
QwtAnalogClock - An analog clock.
Synopsis
#include <qwt_analog_clock.h>
Inherits QwtDial.
PublicTypes
enum Hand { SecondHand, MinuteHand, HourHand, NHands }
PublicSlots
void setCurrentTime ()
Set the current time.
void setTime (const QTime &)
PublicMemberFunctionsQwtAnalogClock (QWidget *parent=NULL)
virtual ~QwtAnalogClock ()
Destructor.
void setHand (Hand, QwtDialNeedle *)
const QwtDialNeedle * hand (Hand) const
QwtDialNeedle * hand (Hand)
ProtectedMemberFunctions
virtual void drawNeedle (QPainter *, const QPointF &, double radius, double direction,
QPalette::ColorGroup) const
Draw the needle.
virtual void drawHand (QPainter *, Hand, const QPointF &, double radius, double direction,
QPalette::ColorGroup) const
AdditionalInheritedMembers