<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html><head><title>QLCDNumber Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } td.postheader { font-family: sans-serif } tr.address { font-family: sans-serif } body { background: #ffffff; color: black; } </style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QLCDNumber Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QLCDNumber widget displays a number with LCD-like digits. <a href="#details">More...</a></p> <p>Inherits <a href="qframe.html">QFrame</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qlcdnumber.html#Mode-enum">Mode</a></b> { Hex, Dec, Oct, Bin }</li><li><div class="fn" />enum <b><a href="qlcdnumber.html#SegmentStyle-enum">SegmentStyle</a></b> { Outline, Filled, Flat }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qlcdnumber.html#QLCDNumber">__init__</a></b> (<i>self</i>, QWidget <i>parent</i> = None)</li><li><div class="fn" /><b><a href="qlcdnumber.html#QLCDNumber-2">__init__</a></b> (<i>self</i>, int <i>numDigits</i>, QWidget <i>parent</i> = None)</li><li><div class="fn" />bool <b><a href="qlcdnumber.html#checkOverflow">checkOverflow</a></b> (<i>self</i>, float <i>num</i>)</li><li><div class="fn" />bool <b><a href="qlcdnumber.html#checkOverflow-2">checkOverflow</a></b> (<i>self</i>, int <i>num</i>)</li><li><div class="fn" />int <b><a href="qlcdnumber.html#digitCount">digitCount</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlcdnumber.html#display">display</a></b> (<i>self</i>, QString <i>str</i>)</li><li><div class="fn" /><b><a href="qlcdnumber.html#display-2">display</a></b> (<i>self</i>, float <i>num</i>)</li><li><div class="fn" /><b><a href="qlcdnumber.html#display-3">display</a></b> (<i>self</i>, int <i>num</i>)</li><li><div class="fn" />bool <b><a href="qlcdnumber.html#event">event</a></b> (<i>self</i>, QEvent <i>e</i>)</li><li><div class="fn" />int <b><a href="qlcdnumber.html#intValue">intValue</a></b> (<i>self</i>)</li><li><div class="fn" />Mode <b><a href="qlcdnumber.html#mode">mode</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qlcdnumber.html#numDigits">numDigits</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlcdnumber.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent)</li><li><div class="fn" />SegmentStyle <b><a href="qlcdnumber.html#segmentStyle">segmentStyle</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlcdnumber.html#setBinMode">setBinMode</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlcdnumber.html#setDecMode">setDecMode</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlcdnumber.html#setDigitCount">setDigitCount</a></b> (<i>self</i>, int <i>nDigits</i>)</li><li><div class="fn" /><b><a href="qlcdnumber.html#setHexMode">setHexMode</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlcdnumber.html#setMode">setMode</a></b> (<i>self</i>, Mode)</li><li><div class="fn" /><b><a href="qlcdnumber.html#setNumDigits">setNumDigits</a></b> (<i>self</i>, int <i>nDigits</i>)</li><li><div class="fn" /><b><a href="qlcdnumber.html#setOctMode">setOctMode</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlcdnumber.html#setSegmentStyle">setSegmentStyle</a></b> (<i>self</i>, SegmentStyle)</li><li><div class="fn" /><b><a href="qlcdnumber.html#setSmallDecimalPoint">setSmallDecimalPoint</a></b> (<i>self</i>, bool)</li><li><div class="fn" />QSize <b><a href="qlcdnumber.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qlcdnumber.html#smallDecimalPoint">smallDecimalPoint</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qlcdnumber.html#value">value</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qlcdnumber.html#overflow">overflow</a></b> ()</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QLCDNumber widget displays a number with LCD-like digits.</p> <p>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 <a href="qlcdnumber.html#intValue-prop">display</a>() slot, which is overloaded to take any of five argument types.</p> <p>There are also slots to change the base with <a href="qlcdnumber.html#mode-prop">setMode</a>() and the decimal point with <a href="qlcdnumber.html#smallDecimalPoint-prop">setSmallDecimalPoint</a>().</p> <p>QLCDNumber emits the <a href="qlcdnumber.html#overflow">overflow</a>() signal when it is asked to display something beyond its range. The range is set by <a href="qlcdnumber.html#digitCount-prop">setDigitCount</a>(), but <a href="qlcdnumber.html#smallDecimalPoint-prop">setSmallDecimalPoint</a>() also influences it. If the display is set to hexadecimal, octal or binary, the integer equivalent of the value is displayed.</p> <p>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.</p> <p>It is not possible to retrieve the contents of a QLCDNumber object, although you can retrieve the numeric value with <a href="qlcdnumber.html#value-prop">value</a>(). If you really need the text, we recommend that you connect the signals that feed the <a href="qlcdnumber.html#intValue-prop">display</a>() slot to another slot as well and store the value there.</p> <p>Incidentally, QLCDNumber is the very oldest part of Qt, tracing its roots back to a BASIC program on the <a href="http://www.nvg.ntnu.no/sinclair/computers/zxspectrum/zxspectrum.htm"> Sinclair Spectrum</a>.</p> <table class="generic"> <tr class="odd" valign="top"> <td><img alt="Screenshot of a Motif style LCD number widget" src="images/motif-lcdnumber.png" /> <img alt="Screenshot of a CDE style LCD number widget" src="images/cde-lcdnumber.png" /> <img alt="Screenshot of a Windows style LCD number widget" src="images/windows-lcdnumber.png" /> <img alt="Screenshot of a Windows XP style LCD number widget" src="images/windowsxp-lcdnumber.png" /> <img alt="Screenshot of a Macintosh style LCD number widget" src="images/macintosh-lcdnumber.png" /> <img alt="Screenshot of a Plastique style LCD number widget" src="images/plastique-lcdnumber.png" /></td> </tr> <tr class="even" valign="top"> <td>LCD number widgets shown in various widget styles (from left to right): <a href="gallery-motif.html">Motif</a>, <a href="gallery-cde.html">CDE</a>, <a href="gallery-windows.html">Windows</a>, <a href="gallery-windowsxp.html">Windows XP</a>, <a href="gallery-macintosh.html">Macintosh</a>, <a href="gallery-plastique.html">Plastique</a>.</td> </tr> </table> <hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Mode-enum" />QLCDNumber.Mode</h3><p>This type determines how numbers are shown.</p> <table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QLCDNumber.Hex</tt></td> <td class="topAlign"><tt>0</tt></td> <td class="topAlign">Hexadecimal</td> </tr> <tr> <td class="topAlign"><tt>QLCDNumber.Dec</tt></td> <td class="topAlign"><tt>1</tt></td> <td class="topAlign">Decimal</td> </tr> <tr> <td class="topAlign"><tt>QLCDNumber.Oct</tt></td> <td class="topAlign"><tt>2</tt></td> <td class="topAlign">Octal</td> </tr> <tr> <td class="topAlign"><tt>QLCDNumber.Bin</tt></td> <td class="topAlign"><tt>3</tt></td> <td class="topAlign">Binary</td> </tr> </table> <p>If the display is set to hexadecimal, octal or binary, the integer equivalent of the value is displayed.</p> <h3 class="fn"><a name="SegmentStyle-enum" />QLCDNumber.SegmentStyle</h3><p>This type determines the visual appearance of the <a href="qlcdnumber.html">QLCDNumber</a> widget.</p> <table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QLCDNumber.Outline</tt></td> <td class="topAlign"><tt>0</tt></td> <td class="topAlign">gives raised segments filled with the background color.</td> </tr> <tr> <td class="topAlign"><tt>QLCDNumber.Filled</tt></td> <td class="topAlign"><tt>1</tt></td> <td class="topAlign">gives raised segments filled with the windowText color.</td> </tr> <tr> <td class="topAlign"><tt>QLCDNumber.Flat</tt></td> <td class="topAlign"><tt>2</tt></td> <td class="topAlign">gives flat segments filled with the windowText color.</td> </tr> </table> <hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QLCDNumber" />QLCDNumber.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>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 <a href="qlcdnumber.html#segmentStyle-prop">segmentStyle</a>() is set to <tt>Outline</tt>.</p> <p>The <i>parent</i> argument is passed to the <a href="qframe.html">QFrame</a> constructor.</p> <p><b>See also</b> <a href="qlcdnumber.html#digitCount-prop">setDigitCount</a>() and <a href="qlcdnumber.html#smallDecimalPoint-prop">setSmallDecimalPoint</a>().</p> <h3 class="fn"><a name="QLCDNumber-2" />QLCDNumber.__init__ (<i>self</i>, int <i>numDigits</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an LCD number, sets the number of digits to <i>numDigits</i>, the base to decimal, the decimal point mode to 'small' and the frame style to a raised box. The <a href="qlcdnumber.html#segmentStyle-prop">segmentStyle</a>() is set to <tt>Filled</tt>.</p> <p>The <i>parent</i> argument is passed to the <a href="qframe.html">QFrame</a> constructor.</p> <p><b>See also</b> <a href="qlcdnumber.html#digitCount-prop">setDigitCount</a>() and <a href="qlcdnumber.html#smallDecimalPoint-prop">setSmallDecimalPoint</a>().</p> <h3 class="fn"><a name="checkOverflow" />bool QLCDNumber.checkOverflow (<i>self</i>, float <i>num</i>)</h3><p>Returns true if <i>num</i> is too big to be displayed in its entirety; otherwise returns false.</p> <p><b>See also</b> <a href="qlcdnumber.html#intValue-prop">display</a>(), <a href="qlcdnumber.html#digitCount-prop">digitCount</a>(), and <a href="qlcdnumber.html#smallDecimalPoint-prop">smallDecimalPoint</a>().</p> <h3 class="fn"><a name="checkOverflow-2" />bool QLCDNumber.checkOverflow (<i>self</i>, int <i>num</i>)</h3><p>This is an overloaded function.</p> <p>Returns true if <i>num</i> is too big to be displayed in its entirety; otherwise returns false.</p> <p><b>See also</b> <a href="qlcdnumber.html#intValue-prop">display</a>(), <a href="qlcdnumber.html#digitCount-prop">digitCount</a>(), and <a href="qlcdnumber.html#smallDecimalPoint-prop">smallDecimalPoint</a>().</p> <h3 class="fn"><a name="digitCount" />int QLCDNumber.digitCount (<i>self</i>)</h3><h3 class="fn"><a name="display" />QLCDNumber.display (<i>self</i>, QString <i>str</i>)</h3><h3 class="fn"><a name="display-2" />QLCDNumber.display (<i>self</i>, float <i>num</i>)</h3><h3 class="fn"><a name="display-3" />QLCDNumber.display (<i>self</i>, int <i>num</i>)</h3><h3 class="fn"><a name="event" />bool QLCDNumber.event (<i>self</i>, <a href="qevent.html">QEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p> <h3 class="fn"><a name="intValue" />int QLCDNumber.intValue (<i>self</i>)</h3><h3 class="fn"><a name="mode" /><a href="qlcdnumber.html#Mode-enum">Mode</a> QLCDNumber.mode (<i>self</i>)</h3><h3 class="fn"><a name="numDigits" />int QLCDNumber.numDigits (<i>self</i>)</h3><h3 class="fn"><a name="paintEvent" />QLCDNumber.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p> <h3 class="fn"><a name="segmentStyle" /><a href="qlcdnumber.html#SegmentStyle-enum">SegmentStyle</a> QLCDNumber.segmentStyle (<i>self</i>)</h3><h3 class="fn"><a name="setBinMode" />QLCDNumber.setBinMode (<i>self</i>)</h3><p>Calls setMode(Bin). Provided for convenience (e.g. for connecting buttons to it).</p> <p><b>See also</b> <a href="qlcdnumber.html#mode-prop">setMode</a>(), <a href="qlcdnumber.html#setHexMode">setHexMode</a>(), <a href="qlcdnumber.html#setDecMode">setDecMode</a>(), <a href="qlcdnumber.html#setOctMode">setOctMode</a>(), and <a href="qlcdnumber.html#mode-prop">mode</a>().</p> <h3 class="fn"><a name="setDecMode" />QLCDNumber.setDecMode (<i>self</i>)</h3><p>Calls setMode(Dec). Provided for convenience (e.g. for connecting buttons to it).</p> <p><b>See also</b> <a href="qlcdnumber.html#mode-prop">setMode</a>(), <a href="qlcdnumber.html#setHexMode">setHexMode</a>(), <a href="qlcdnumber.html#setOctMode">setOctMode</a>(), <a href="qlcdnumber.html#setBinMode">setBinMode</a>(), and <a href="qlcdnumber.html#mode-prop">mode</a>().</p> <h3 class="fn"><a name="setDigitCount" />QLCDNumber.setDigitCount (<i>self</i>, int <i>nDigits</i>)</h3><h3 class="fn"><a name="setHexMode" />QLCDNumber.setHexMode (<i>self</i>)</h3><p>Calls setMode(Hex). Provided for convenience (e.g. for connecting buttons to it).</p> <p><b>See also</b> <a href="qlcdnumber.html#mode-prop">setMode</a>(), <a href="qlcdnumber.html#setDecMode">setDecMode</a>(), <a href="qlcdnumber.html#setOctMode">setOctMode</a>(), <a href="qlcdnumber.html#setBinMode">setBinMode</a>(), and <a href="qlcdnumber.html#mode-prop">mode</a>().</p> <h3 class="fn"><a name="setMode" />QLCDNumber.setMode (<i>self</i>, <a href="qlcdnumber.html#Mode-enum">Mode</a>)</h3><h3 class="fn"><a name="setNumDigits" />QLCDNumber.setNumDigits (<i>self</i>, int <i>nDigits</i>)</h3><h3 class="fn"><a name="setOctMode" />QLCDNumber.setOctMode (<i>self</i>)</h3><p>Calls setMode(Oct). Provided for convenience (e.g. for connecting buttons to it).</p> <p><b>See also</b> <a href="qlcdnumber.html#mode-prop">setMode</a>(), <a href="qlcdnumber.html#setHexMode">setHexMode</a>(), <a href="qlcdnumber.html#setDecMode">setDecMode</a>(), <a href="qlcdnumber.html#setBinMode">setBinMode</a>(), and <a href="qlcdnumber.html#mode-prop">mode</a>().</p> <h3 class="fn"><a name="setSegmentStyle" />QLCDNumber.setSegmentStyle (<i>self</i>, <a href="qlcdnumber.html#SegmentStyle-enum">SegmentStyle</a>)</h3><h3 class="fn"><a name="setSmallDecimalPoint" />QLCDNumber.setSmallDecimalPoint (<i>self</i>, bool)</h3><h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QLCDNumber.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a>().</p> <h3 class="fn"><a name="smallDecimalPoint" />bool QLCDNumber.smallDecimalPoint (<i>self</i>)</h3><h3 class="fn"><a name="value" />float QLCDNumber.value (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="overflow" />void overflow ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the <a href="qlcdnumber.html">QLCDNumber</a> is asked to display a too-large number or a too-long string.</p> <p>It is never emitted by <a href="qlcdnumber.html#digitCount-prop">setDigitCount</a>().</p> <address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.10.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>