[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/qlcdnumber.h:1 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>qlcdnumber.h Include File</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qlcdnumber.h</h1>
|
---|
| 33 |
|
---|
| 34 | <p>This is the verbatim text of the qlcdnumber.h include file. It is provided only for illustration; the copyright remains with Trolltech.
|
---|
| 35 | <hr>
|
---|
| 36 | <pre>
|
---|
| 37 | /****************************************************************************
|
---|
| 38 | ** $Id: qlcdnumber-h.html 2051 2007-02-21 10:04:20Z chehrlic $
|
---|
| 39 | **
|
---|
| 40 | ** Definition of QLCDNumber class
|
---|
| 41 | **
|
---|
| 42 | ** Created : 940518
|
---|
| 43 | **
|
---|
| 44 | ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
|
---|
| 45 | **
|
---|
| 46 | ** This file is part of the widgets module of the Qt GUI Toolkit.
|
---|
| 47 | **
|
---|
| 48 | ** This file may be distributed under the terms of the Q Public License
|
---|
| 49 | ** as defined by Trolltech ASA of Norway and appearing in the file
|
---|
| 50 | ** LICENSE.QPL included in the packaging of this file.
|
---|
| 51 | **
|
---|
| 52 | ** This file may be distributed and/or modified under the terms of the
|
---|
| 53 | ** GNU General Public License version 2 as published by the Free Software
|
---|
| 54 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
| 55 | ** packaging of this file.
|
---|
| 56 | **
|
---|
| 57 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
| 58 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
| 59 | ** Agreement provided with the Software.
|
---|
| 60 | **
|
---|
| 61 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
| 62 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
| 63 | **
|
---|
| 64 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
| 65 | ** information about Qt Commercial License Agreements.
|
---|
| 66 | ** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
---|
| 67 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
| 68 | **
|
---|
| 69 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
| 70 | ** not clear to you.
|
---|
| 71 | **
|
---|
| 72 | **********************************************************************/
|
---|
| 73 |
|
---|
| 74 | #ifndef QLCDNUMBER_H
|
---|
| 75 | #define QLCDNUMBER_H
|
---|
| 76 |
|
---|
| 77 | #ifndef QT_H
|
---|
| 78 | #include "qframe.h"
|
---|
| 79 | #include "qbitarray.h"
|
---|
| 80 | #endif // QT_H
|
---|
| 81 |
|
---|
| 82 | #ifndef QT_NO_LCDNUMBER
|
---|
| 83 |
|
---|
| 84 |
|
---|
| 85 | class QLCDNumberPrivate;
|
---|
| 86 |
|
---|
| 87 | class Q_EXPORT QLCDNumber : public QFrame // LCD number widget
|
---|
| 88 | {
|
---|
| 89 | Q_OBJECT
|
---|
| 90 | Q_ENUMS( Mode SegmentStyle )
|
---|
| 91 | Q_PROPERTY( bool smallDecimalPoint READ smallDecimalPoint WRITE setSmallDecimalPoint )
|
---|
| 92 | Q_PROPERTY( int numDigits READ numDigits WRITE setNumDigits )
|
---|
| 93 | Q_PROPERTY( Mode mode READ mode WRITE setMode )
|
---|
| 94 | Q_PROPERTY( SegmentStyle segmentStyle READ segmentStyle WRITE setSegmentStyle )
|
---|
| 95 | Q_PROPERTY( double value READ value WRITE display )
|
---|
| 96 | Q_PROPERTY( int intValue READ intValue WRITE display )
|
---|
| 97 |
|
---|
| 98 | public:
|
---|
| 99 | QLCDNumber( QWidget* parent=0, const char* name=0 );
|
---|
| 100 | QLCDNumber( uint numDigits, QWidget* parent=0, const char* name=0 );
|
---|
| 101 | ~QLCDNumber();
|
---|
| 102 |
|
---|
| 103 | enum Mode { Hex, Dec, Oct, Bin, HEX = Hex, DEC = Dec, OCT = Oct,
|
---|
| 104 | BIN = Bin };
|
---|
| 105 | enum SegmentStyle { Outline, Filled, Flat };
|
---|
| 106 |
|
---|
| 107 | bool smallDecimalPoint() const;
|
---|
| 108 |
|
---|
| 109 | int numDigits() const;
|
---|
| 110 | virtual void setNumDigits( int nDigits );
|
---|
| 111 |
|
---|
| 112 | bool checkOverflow( double num ) const;
|
---|
| 113 | bool checkOverflow( int num ) const;
|
---|
| 114 |
|
---|
| 115 | Mode mode() const;
|
---|
| 116 | virtual void setMode( Mode );
|
---|
| 117 |
|
---|
| 118 | SegmentStyle segmentStyle() const;
|
---|
| 119 | virtual void setSegmentStyle( SegmentStyle );
|
---|
| 120 |
|
---|
| 121 | double value() const;
|
---|
| 122 | int intValue() const;
|
---|
| 123 |
|
---|
| 124 | QSize sizeHint() const;
|
---|
| 125 |
|
---|
| 126 | public slots:
|
---|
| 127 | void display( const QString &str );
|
---|
| 128 | void display( int num );
|
---|
| 129 | void display( double num );
|
---|
| 130 | virtual void setHexMode();
|
---|
| 131 | virtual void setDecMode();
|
---|
| 132 | virtual void setOctMode();
|
---|
| 133 | virtual void setBinMode();
|
---|
| 134 | virtual void setSmallDecimalPoint( bool );
|
---|
| 135 |
|
---|
| 136 | signals:
|
---|
| 137 | void overflow();
|
---|
| 138 |
|
---|
| 139 | protected:
|
---|
| 140 | void drawContents( QPainter * );
|
---|
| 141 |
|
---|
| 142 | private:
|
---|
| 143 | void init();
|
---|
| 144 | void internalDisplay( const QString &);
|
---|
| 145 | void internalSetString( const QString& s );
|
---|
| 146 | void drawString( const QString& s, QPainter &, QBitArray * = 0,
|
---|
| 147 | bool = TRUE );
|
---|
| 148 | //void drawString( const QString &, QPainter &, QBitArray * = 0 ) const;
|
---|
| 149 | void drawDigit( const QPoint &, QPainter &, int, char,
|
---|
| 150 | char = ' ' );
|
---|
| 151 | void drawSegment( const QPoint &, char, QPainter &, int, bool = FALSE );
|
---|
| 152 |
|
---|
| 153 | int ndigits;
|
---|
| 154 | double val;
|
---|
| 155 | uint base : 2;
|
---|
| 156 | uint smallPoint : 1;
|
---|
| 157 | uint fill : 1;
|
---|
| 158 | uint shadow : 1;
|
---|
| 159 | QString digitStr;
|
---|
| 160 | QBitArray points;
|
---|
| 161 | QLCDNumberPrivate * d;
|
---|
| 162 |
|
---|
| 163 | private: // Disabled copy constructor and operator=
|
---|
| 164 | #if defined(Q_DISABLE_COPY)
|
---|
| 165 | QLCDNumber( const QLCDNumber & );
|
---|
| 166 | QLCDNumber &operator=( const QLCDNumber & );
|
---|
| 167 | #endif
|
---|
| 168 | };
|
---|
| 169 |
|
---|
| 170 | inline bool QLCDNumber::smallDecimalPoint() const
|
---|
| 171 | { return (bool)smallPoint; }
|
---|
| 172 |
|
---|
| 173 | inline int QLCDNumber::numDigits() const
|
---|
| 174 | { return ndigits; }
|
---|
| 175 |
|
---|
| 176 |
|
---|
| 177 | #endif // QT_NO_LCDNUMBER
|
---|
| 178 |
|
---|
| 179 | #endif // QLCDNUMBER_H
|
---|
| 180 | </pre>
|
---|
| 181 | <!-- eof -->
|
---|
| 182 | <p><address><hr><div align=center>
|
---|
| 183 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 184 | <td>Copyright © 2007
|
---|
| 185 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 186 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 187 | </table></div></address></body>
|
---|
| 188 | </html>
|
---|