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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
'\" t
.TH QLCDNumber 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QLCDNumber \- Displays a number with LCD-like digits
.SH SYNOPSIS
\fC#include <ntqlcdnumber.h>\fR
.PP
Inherits QFrame.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQLCDNumber\fR ( TQWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fBQLCDNumber\fR ( uint numDigits, TQWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fB~QLCDNumber\fR ()"
.br
.ti -1c
.BI "enum \fBMode\fR { Hex, Dec, Oct, Bin, HEX = Hex, DEC = Dec, OCT = Oct, BIN = Bin }"
.br
.ti -1c
.BI "enum \fBSegmentStyle\fR { Outline, Filled, Flat }"
.br
.ti -1c
.BI "bool \fBsmallDecimalPoint\fR () const"
.br
.ti -1c
.BI "int \fBnumDigits\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetNumDigits\fR ( int nDigits )"
.br
.ti -1c
.BI "bool \fBcheckOverflow\fR ( double num ) const"
.br
.ti -1c
.BI "bool \fBcheckOverflow\fR ( int num ) const"
.br
.ti -1c
.BI "Mode \fBmode\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetMode\fR ( Mode )"
.br
.ti -1c
.BI "SegmentStyle \fBsegmentStyle\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetSegmentStyle\fR ( SegmentStyle )"
.br
.ti -1c
.BI "double \fBvalue\fR () const"
.br
.ti -1c
.BI "int \fBintValue\fR () const"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "void \fBdisplay\fR ( const TQString & s )"
.br
.ti -1c
.BI "void \fBdisplay\fR ( int num )"
.br
.ti -1c
.BI "void \fBdisplay\fR ( double num )"
.br
.ti -1c
.BI "virtual void \fBsetHexMode\fR ()"
.br
.ti -1c
.BI "virtual void \fBsetDecMode\fR ()"
.br
.ti -1c
.BI "virtual void \fBsetOctMode\fR ()"
.br
.ti -1c
.BI "virtual void \fBsetBinMode\fR ()"
.br
.ti -1c
.BI "virtual void \fBsetSmallDecimalPoint\fR ( bool )"
.br
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.BI "void \fBoverflow\fR ()"
.br
.in -1c
.SS "Properties"
.in +1c
.ti -1c
.BI "int \fBintValue\fR - the displayed value rounded to the nearest integer"
.br
.ti -1c
.BI "Mode \fBmode\fR - the current display mode (number " "base" ")"
.br
.ti -1c
.BI "int \fBnumDigits\fR - the current number of digits displayed"
.br
.ti -1c
.BI "SegmentStyle \fBsegmentStyle\fR - the style of the LCDNumber"
.br
.ti -1c
.BI "bool \fBsmallDecimalPoint\fR - the style of the decimal point"
.br
.ti -1c
.BI "double \fBvalue\fR - the displayed value"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual void \fBdrawContents\fR ( TQPainter * p )"
.br
.in -1c
.SH DESCRIPTION
The QLCDNumber widget displays a number with LCD-like digits.
.PP
It can display a number in just about any size. It can display decimal, hexadecimal, octal or binary numbers. It is easy to connect to data sources using the display() slot, which is overloaded to take any of five argument types.
.PP
There are also slots to change the base with setMode() and the decimal point with setSmallDecimalPoint().
.PP
QLCDNumber emits the overflow() signal when it is asked to display something beyond its range. The range is set by setNumDigits(), but setSmallDecimalPoint() also influences it. If the display is set to hexadecimal, octal or binary, the integer equivalent of the value is displayed.
.PP
These digits and other symbols can be shown: 0/O, 1, 2, 3, 4, 5/S, 6, 7, 8, 9/g, minus, decimal point, A, B, C, D, E, F, h, H, L, o, P, r, u, U, Y, colon, degree sign (which is specified as single quote in the string) and space. QLCDNumber substitutes spaces for illegal characters.
.PP
It is not possible to retrieve the contents of a QLCDNumber object, although you can retrieve the numeric value with value(). If you really need the text, we recommend that you connect the signals that feed the display() slot to another slot as well and store the value there.
.PP
Incidentally, QLCDNumber is the very oldest part of Qt, tracing back to a BASIC program on the Sinclair Spectrum.
.PP
.ce 1
.B "[Image Omitted]"
.PP
.ce 1
.B "[Image Omitted]"
.PP
See also QLabel, QFrame, and Basic Widgets.
.SS "Member Type Documentation"
.SH "QLCDNumber::Mode"
This type determines how numbers are shown.
.TP
\fCQLCDNumber::Hex\fR - Hexadecimal
.TP
\fCQLCDNumber::Dec\fR - Decimal
.TP
\fCQLCDNumber::Oct\fR - Octal
.TP
\fCQLCDNumber::Bin\fR - Binary
.PP
If the display is set to hexadecimal, octal or binary, the integer equivalent of the value is displayed.
.SH "QLCDNumber::SegmentStyle"
This type determines the visual appearance of the QLCDNumber widget.
.TP
\fCQLCDNumber::Outline\fR - gives raised segments filled with the background brush.
.TP
\fCQLCDNumber::Filled\fR - gives raised segments filled with the foreground brush.
.TP
\fCQLCDNumber::Flat\fR - gives flat segments filled with the foreground brush.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QLCDNumber::QLCDNumber ( TQWidget * parent = 0, const char * name = 0 )"
Constructs an LCD number, sets the number of digits to 5, the base to decimal, the decimal point mode to 'small' and the frame style to a raised box. The segmentStyle() is set to Outline.
.PP
The \fIparent\fR and \fIname\fR arguments are passed to the QFrame constructor.
.PP
See also numDigits and smallDecimalPoint.
.SH "QLCDNumber::QLCDNumber ( uint numDigits, TQWidget * parent = 0, const char * name = 0 )"
Constructs an LCD number, sets the number of digits to \fInumDigits\fR, the base to decimal, the decimal point mode to 'small' and the frame style to a raised box. The segmentStyle() is set to Outline.
.PP
The \fIparent\fR and \fIname\fR arguments are passed to the QFrame constructor.
.PP
See also numDigits and smallDecimalPoint.
.SH "QLCDNumber::~QLCDNumber ()"
Destroys the LCD number.
.SH "bool QLCDNumber::checkOverflow ( double num ) const"
Returns TRUE if \fInum\fR is too big to be displayed in its entirety; otherwise returns FALSE.
.PP
See also display(), numDigits, and smallDecimalPoint.
.SH "bool QLCDNumber::checkOverflow ( int num ) const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if \fInum\fR is too big to be displayed in its entirety; otherwise returns FALSE.
.PP
See also display(), numDigits, and smallDecimalPoint.
.SH "void QLCDNumber::display ( const TQString & s )\fC [slot]\fR"
Displays the number represented by the string \fIs\fR.
.PP
This version of the function disregards mode() and smallDecimalPoint().
.PP
These digits and other symbols can be shown: 0/O, 1, 2, 3, 4, 5/S, 6, 7, 8, 9/g, minus, decimal point, A, B, C, D, E, F, h, H, L, o, P, r, u, U, Y, colon, degree sign (which is specified as single quote in the string) and space. QLCDNumber substitutes spaces for illegal characters.
.PP
Examples:
.)l rangecontrols/rangecontrols.cpp, t12/lcdrange.cpp, t13/gamebrd.cpp, t5/main.cpp, t6/main.cpp, t7/lcdrange.cpp, and xform/xform.cpp.
.SH "void QLCDNumber::display ( int num )\fC [slot]\fR"
Sets the displayed value rounded to the nearest integer to \fInum\fR. See the "intValue" property for details.
.SH "void QLCDNumber::display ( double num )\fC [slot]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Displays the number \fInum\fR.
.SH "void QLCDNumber::drawContents ( TQPainter * p )\fC [virtual protected]\fR"
Draws the LCD number using painter \fIp\fR. This function is called from QFrame::paintEvent().
.PP
Reimplemented from QFrame.
.SH "int QLCDNumber::intValue () const"
Returns the displayed value rounded to the nearest integer. See the "intValue" property for details.
.SH "Mode QLCDNumber::mode () const"
Returns the current display mode (number base). See the "mode" property for details.
.SH "int QLCDNumber::numDigits () const"
Returns the current number of digits displayed. See the "numDigits" property for details.
.SH "void QLCDNumber::overflow ()\fC [signal]\fR"
This signal is emitted whenever the QLCDNumber is asked to display a too-large number or a too-long string.
.PP
It is never emitted by setNumDigits().
.SH "SegmentStyle QLCDNumber::segmentStyle () const"
Returns the style of the LCDNumber. See the "segmentStyle" property for details.
.SH "void QLCDNumber::setBinMode ()\fC [virtual slot]\fR"
Calls setMode( BIN ). Provided for convenience (e.g. for connecting buttons to it).
.PP
See also mode, setHexMode(), setDecMode(), setOctMode(), and mode.
.SH "void QLCDNumber::setDecMode ()\fC [virtual slot]\fR"
Calls setMode( DEC ). Provided for convenience (e.g. for connecting buttons to it).
.PP
See also mode, setHexMode(), setOctMode(), setBinMode(), and mode.
.SH "void QLCDNumber::setHexMode ()\fC [virtual slot]\fR"
Calls setMode( HEX ). Provided for convenience (e.g. for connecting buttons to it).
.PP
See also mode, setDecMode(), setOctMode(), setBinMode(), and mode.
.SH "void QLCDNumber::setMode ( Mode )\fC [virtual]\fR"
Sets the current display mode (number base). See the "mode" property for details.
.SH "void QLCDNumber::setNumDigits ( int nDigits )\fC [virtual]\fR"
Sets the current number of digits displayed to \fInDigits\fR. See the "numDigits" property for details.
.SH "void QLCDNumber::setOctMode ()\fC [virtual slot]\fR"
Calls setMode( OCT ). Provided for convenience (e.g. for connecting buttons to it).
.PP
See also mode, setHexMode(), setDecMode(), setBinMode(), and mode.
.SH "void QLCDNumber::setSegmentStyle ( SegmentStyle )\fC [virtual]\fR"
Sets the style of the LCDNumber. See the "segmentStyle" property for details.
.SH "void QLCDNumber::setSmallDecimalPoint ( bool )\fC [virtual slot]\fR"
Sets the style of the decimal point. See the "smallDecimalPoint" property for details.
.SH "bool QLCDNumber::smallDecimalPoint () const"
Returns the style of the decimal point. See the "smallDecimalPoint" property for details.
.SH "double QLCDNumber::value () const"
Returns the displayed value. See the "value" property for details.
.SS "Property Documentation"
.SH "int intValue"
This property holds the displayed value rounded to the nearest integer.
.PP
This property corresponds to the nearest integer to the current value displayed by the LCDNumber. This is the value used for hexadecimal, octal and binary modes.
.PP
If the displayed value is not a number, the property has a value of 0.
.PP
Set this property's value with display() and get this property's value with intValue().
.SH "Mode mode"
This property holds the current display mode (number base).
.PP
Corresponds to the current display mode, which is one of BIN, OCT, DEC (the default) and HEX. DEC mode can display floating point values, the other modes display the integer equivalent.
.PP
See also smallDecimalPoint, setHexMode(), setDecMode(), setOctMode(), and setBinMode().
.PP
Set this property's value with setMode() and get this property's value with mode().
.SH "int numDigits"
This property holds the current number of digits displayed.
.PP
Corresponds to the current number of digits. If QLCDNumber::smallDecimalPoint is FALSE, the decimal point occupies one digit position.
.PP
See also smallDecimalPoint.
.PP
Set this property's value with setNumDigits() and get this property's value with numDigits().
.SH "SegmentStyle segmentStyle"
This property holds the style of the LCDNumber.
.PP
<center>.nf
.TS
l - l. Style Result Outline Produces raised segments filled with the background color (this is the default). Filled Produces raised segments filled with the foreground color. Flat
.TE
.fi
</center>
.PP
Outline and Filled will additionally use TQColorGroup::light() and TQColorGroup::dark() for shadow effects.
.PP
Set this property's value with setSegmentStyle() and get this property's value with segmentStyle().
.SH "bool smallDecimalPoint"
This property holds the style of the decimal point.
.PP
If TRUE the decimal point is drawn between two digit positions. Otherwise it occupies a digit position of its own, i.e. is drawn in a digit position. The default is FALSE.
.PP
The inter-digit space is made slightly wider when the decimal point is drawn between the digits.
.PP
See also mode.
.PP
Set this property's value with setSmallDecimalPoint() and get this property's value with smallDecimalPoint().
.SH "double value"
This property holds the displayed value.
.PP
This property corresponds to the current value displayed by the LCDNumber.
.PP
If the displayed value is not a number, the property has a value of 0.
.PP
Set this property's value with display() and get this property's value with value().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/ntqlcdnumber.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR [email protected] .
Please include the name of the manual page (tqlcdnumber.3qt) and the Qt
version (3.3.8).
|