1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
3
* Copyright (C) 1997 Josef Wilgen
4
* Copyright (C) 2002 Uwe Rathmann
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the Qwt License, Version 1.0
8
*****************************************************************************/
10
#ifndef QWT_ANALOG_CLOCK_H
11
#define QWT_ANALOG_CLOCK_H
13
#include <qdatetime.h>
14
#include "qwt_global.h"
16
#include "qwt_dial_needle.h"
19
\brief An analog clock
21
\image html analogclock.png
24
\verbatim #include <qwt_analog_clock.h>
26
QwtAnalogClock *clock = new QwtAnalogClock(...);
27
clock->scaleDraw()->setPenWidth(3);
28
clock->setLineWidth(6);
29
clock->setFrameShadow(QwtDial::Sunken);
32
// update the clock every second
33
QTimer *timer = new QTimer(clock);
34
timer->connect(timer, SIGNAL(timeout()), clock, SLOT(setCurrentTime()));
39
Qwt is missing a set of good looking hands.
40
Contributions are very welcome.
42
\note The examples/dials example shows how to use QwtAnalogClock.
45
class QWT_EXPORT QwtAnalogClock: public QwtDial
64
explicit QwtAnalogClock(QWidget* parent = NULL);
65
#if QT_VERSION < 0x040000
66
explicit QwtAnalogClock(QWidget* parent, const char *name);
68
virtual ~QwtAnalogClock();
70
virtual void setHand(Hand, QwtDialNeedle *);
71
const QwtDialNeedle *hand(Hand) const;
72
QwtDialNeedle *hand(Hand);
75
void setCurrentTime();
76
void setTime(const QTime & = QTime::currentTime());
79
virtual QwtText scaleLabel(double) const;
81
virtual void drawNeedle(QPainter *, const QPoint &,
82
int radius, double direction, QPalette::ColorGroup) const;
84
virtual void drawHand(QPainter *, Hand, const QPoint &,
85
int radius, double direction, QPalette::ColorGroup) const;
88
virtual void setNeedle(QwtDialNeedle *);
91
QwtDialNeedle *d_hand[NHands];