QwtAnalogClock.3
4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
.TH "QwtAnalogClock" 3 "Sat Jan 26 2013" "Version 6.1-rc3" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtAnalogClock \-
.PP
An analog clock\&.
.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_analog_clock\&.h>\fP
.PP
Inherits \fBQwtDial\fP\&.
.SS "Public Types"
.in +1c
.ti -1c
.RI "enum \fBHand\fP { \fBSecondHand\fP, \fBMinuteHand\fP, \fBHourHand\fP, \fBNHands\fP }"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.RI "void \fBsetCurrentTime\fP ()"
.br
.RI "\fISet the current time\&. \fP"
.ti -1c
.RI "void \fBsetTime\fP (const QTime &)"
.br
.in -1c
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBQwtAnalogClock\fP (QWidget *parent=NULL)"
.br
.ti -1c
.RI "virtual \fB~QwtAnalogClock\fP ()"
.br
.RI "\fIDestructor\&. \fP"
.ti -1c
.RI "void \fBsetHand\fP (\fBHand\fP, \fBQwtDialNeedle\fP *)"
.br
.ti -1c
.RI "const \fBQwtDialNeedle\fP * \fBhand\fP (\fBHand\fP) const "
.br
.ti -1c
.RI "\fBQwtDialNeedle\fP * \fBhand\fP (\fBHand\fP)"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "virtual void \fBdrawNeedle\fP (QPainter *, const QPointF &, double radius, double direction, QPalette::ColorGroup) const "
.br
.RI "\fIDraw the needle\&. \fP"
.ti -1c
.RI "virtual void \fBdrawHand\fP (QPainter *, \fBHand\fP, const QPointF &, double radius, double direction, QPalette::ColorGroup) const "
.br
.in -1c
.SS "Additional Inherited Members"
.SH "Detailed Description"
.PP
An analog clock\&.
.PP
\fBExample\fP
.RS 4
.PP
.nf
#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);
.fi
.PP
.RE
.PP
\fBNote:\fP
.RS 4
The examples/dials example shows how to use \fBQwtAnalogClock\fP\&.
.RE
.PP
.SH "Member Enumeration Documentation"
.PP
.SS "enum \fBQwtAnalogClock::Hand\fP"
Hand type
.PP
\fBSee Also:\fP
.RS 4
\fBsetHand()\fP, \fBhand()\fP
.RE
.PP
.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fISecondHand \fP\fP
Needle displaying the seconds\&.
.TP
\fB\fIMinuteHand \fP\fP
Needle displaying the minutes\&.
.TP
\fB\fIHourHand \fP\fP
Needle displaying the hours\&.
.TP
\fB\fINHands \fP\fP
Number of needles\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "QwtAnalogClock::QwtAnalogClock (QWidget *parent = \fCNULL\fP)\fC [explicit]\fP"
Constructor
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP Parent widget
.RE
.PP
.SH "Member Function Documentation"
.PP
.SS "void QwtAnalogClock::drawHand (QPainter *painter, \fBHand\fPhd, const QPointF ¢er, doubleradius, doubledirection, QPalette::ColorGroupcg) const\fC [protected]\fP, \fC [virtual]\fP"
Draw a clock hand
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter
.br
\fIhd\fP Specify the type of hand
.br
\fIcenter\fP Center of the clock
.br
\fIradius\fP Maximum length for the hands
.br
\fIdirection\fP Direction of the hand in degrees, counter clockwise
.br
\fIcg\fP ColorGroup
.RE
.PP
.SS "void QwtAnalogClock::drawNeedle (QPainter *painter, const QPointF ¢er, doubleradius, doubledir, QPalette::ColorGroupcolorGroup) const\fC [protected]\fP, \fC [virtual]\fP"
.PP
Draw the needle\&. A clock has no single needle but three hands instead\&. \fBdrawNeedle()\fP translates \fBvalue()\fP into directions for the hands and calls \fBdrawHand()\fP\&.
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter
.br
\fIcenter\fP Center of the clock
.br
\fIradius\fP Maximum length for the hands
.br
\fIdir\fP Dummy, not used\&.
.br
\fIcolorGroup\fP ColorGroup
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBdrawHand()\fP
.RE
.PP
.PP
Reimplemented from \fBQwtDial\fP\&.
.SS "const \fBQwtDialNeedle\fP * QwtAnalogClock::hand (\fBHand\fPhd) const"
\fBReturns:\fP
.RS 4
Clock hand
.RE
.PP
\fBParameters:\fP
.RS 4
\fIhd\fP Specifies the type of hand
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetHand()\fP
.RE
.PP
.SS "\fBQwtDialNeedle\fP * QwtAnalogClock::hand (\fBHand\fPhd)"
\fBReturns:\fP
.RS 4
Clock hand
.RE
.PP
\fBParameters:\fP
.RS 4
\fIhd\fP Specifies the type of hand
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetHand()\fP
.RE
.PP
.SS "void QwtAnalogClock::setHand (\fBHand\fPhand, \fBQwtDialNeedle\fP *needle)"
Set a clock hand
.PP
\fBParameters:\fP
.RS 4
\fIhand\fP Specifies the type of hand
.br
\fIneedle\fP Hand
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBhand()\fP
.RE
.PP
.SS "void QwtAnalogClock::setTime (const QTime &time)\fC [slot]\fP"
Set a time
.PP
\fBParameters:\fP
.RS 4
\fItime\fP Time to display
.RE
.PP
.SH "Author"
.PP
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.