The QLCDNumber widget displays a number with LCD-like digits. More...
#include <qlcdnumber.h>
Inherits QFrame.
It can display a number in just about any size, in decimal, hexadecimal, octal or binary notation, and is easy to connect to data sources via the display() slot, which is overloaded to take any of five argument types.
There are also slots to change the notation mode and decimal point mode.
QLCDNumber emits the overflow() signal when it is asked to display something beyond its range. The range is set by setNumDigits() (but setSmallDecimalPoint() influences it too).
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.
It is impossible to retrieve the contents of a QLCDNumber object. If you need to, we recommend that you connect the signals which feed the display() slot to another slot as well and store the value there.
Warning: The current version of QLCDNumber does not work well with background pixmaps.
Incidentally, QLCDNumber is the very oldest part of Qt, tracing back to a BASIC program on the Sinclair Spectrum.
Examples: dclock/dclock.cpp xform/xform.cpp
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.
The parent and name arguments are passed to the QFrame constructor.
See also: setNumDigits() and setSmallDecimalPoint().
Constructs an LCD number, sets the number of digits to numDigits, the
base to decimal, the decimal point mode to 'small' and the frame style
to a raised box. The segmentStyle() is set to Outline.
The parent and name arguments are passed to the QFrame constructor.
See also: setNumDigits() and setSmallDecimalPoint().
Destroys the LCD number.
Returns TRUE if num is too big to be displayed in its entirety, FALSE otherwise.
See also: display(), numDigits() and smallDecimalPoint().
Returns TRUE if num is too big to be displayed in its entirety, FALSE otherwise.
See also: display(), numDigits() and smallDecimalPoint().
[slot]
Sets the contents of the display to num.
See also: setMode() and smallDecimalPoint().
Examples: dclock/dclock.cpp xform/xform.cpp
[slot]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This version of the function disregards mode() and smallDecimalPoint().
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.
[slot]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[virtual protected]
Draws the LCD number using painter p. This function is called from QFrame::paintEvent().
Reimplemented from QFrame.
Returns the last value set by one of the display() slots rounded to the nearest integer.
If display(const char *) was the last called, 0 is returned.
See also: value() and display().
Returns the current display mode, which is one of BIN, OCT, DEC
and HEX.
See also: setMode() and smallDecimalPoint().
Returns the current number of digits. If smallDecimalPoint() is FALSE, the decimal point occupies one digit position.
See also: setNumDigits() and smallDecimalPoint().
[signal]
This signal is emitted whenever the QLCDNumber is asked to display a too large number or a too long string.
It is never emitted by setNumDigits().
[virtual protected]
Handles resize Events for the QLCDNumber.
Reimplemented from QWidget.
Returns the style of the QLCDNumber.
See also: setSegmentStyle().
[slot]
Calls setMode( BIN ). Provided for convenience (e.g. for connecting buttons to this).
See also: setMode(), setHexMode(), setDecMode(), setOctMode() and mode().
[slot]
Calls setMode( DEC ). Provided for convenience (e.g. for connecting buttons to this).
See also: setMode(), setHexMode(), setOctMode(), setBinMode() and mode().
[slot]
Calls setMode( HEX ). Provided for convenience (e.g. for connecting buttons to this).
See also: setMode(), setDecMode(), setOctMode(), setBinMode() and mode().
Sets the display mode to m, which must be one of BIN, OCT, DEC
and HEX.
All four modes can display both integers, floating-point
numbers and strings (subject to character set limitations).
The display is set to "0".
Example:
myLcd.setMode( QLCDNumber::HEX );
See also: mode(), setHexMode(), setDecMode(), setOctMode(), setBinMode(), setSmallDecimalPoint() and display().
Sets the number of digits shown to numDigits, which is forced into the [0-99] range.
If smallDecimalPoint() is TRUE, numDigits can be shown. If it is FALSE, only numDigits-1 digits can be shown.
See also: numDigits(), setMode(), setSmallDecimalPoint() and overflow().
[slot]
Calls setMode( OCT ). Provided for convenience (e.g. for connecting buttons to this).
See also: setMode(), setHexMode(), setDecMode(), setBinMode() and mode().
Sets the style of the QLCDNumber to s.
Outline
gives raised segments filled with the background color.
Filled
gives raised segments filled with the foreground color.
Flat
gives flat segments filled with the foreground color.
Outline
and Filled
will additionally use QColorGroup::light()
and QColorGroup::dark() for shadow effects.
See also: segmentStyle().
[slot]
If b is TRUE, the decimal point is drawn between two digits. If b is FALSE, the decimal point is drawn in a digit position.
The inter-digit space is made slightly wider when the decimal point is drawn between the digits.
The display is set to "0.0".
See also: smallDecimalPoint() and setMode().
[virtual]
Returns a suitable size for this LCD number. The size hint is on the small side, so as to be usable as minimum size.
The size hint takes numDigits() and smallDecimalPoint() into consideration.
See also: setNumDigits(), setSmallDecimalPoint() and setMinimumSize().
Reimplemented from QWidget.
Returns TRUE if the decimal point is currently drawn between two digit positions, and FALSE if it is drawn in a digit position.
See also: setSmallDecimalPoint() and mode().
Returns the last value set by one of the display() slots.
If display(const char *) was the last called, 0 is returned.
See also: intValue() and display().
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit, copyright © 1995-98 Troll Tech, all rights reserved.
It was generated from the following files:
Copyright © 1998 Troll Tech | Trademarks | Qt version 1.42
|