Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtWidgets/qlcdnumber.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QLCDNUMBER_H
0005 #define QLCDNUMBER_H
0006 
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qframe.h>
0009 
0010 QT_BEGIN_NAMESPACE
0011 
0012 QT_REQUIRE_CONFIG(lcdnumber);
0013 
0014 class QLCDNumberPrivate;
0015 class Q_WIDGETS_EXPORT QLCDNumber : public QFrame // LCD number widget
0016 {
0017     Q_OBJECT
0018     Q_PROPERTY(bool smallDecimalPoint READ smallDecimalPoint WRITE setSmallDecimalPoint)
0019     Q_PROPERTY(int digitCount READ digitCount WRITE setDigitCount)
0020     Q_PROPERTY(Mode mode READ mode WRITE setMode)
0021     Q_PROPERTY(SegmentStyle segmentStyle READ segmentStyle WRITE setSegmentStyle)
0022     Q_PROPERTY(double value READ value WRITE display)
0023     Q_PROPERTY(int intValue READ intValue WRITE display)
0024 
0025 public:
0026     explicit QLCDNumber(QWidget* parent = nullptr);
0027     explicit QLCDNumber(uint numDigits, QWidget* parent = nullptr);
0028     ~QLCDNumber();
0029 
0030     enum Mode {
0031         Hex, Dec, Oct, Bin
0032     };
0033     Q_ENUM(Mode)
0034     enum SegmentStyle {
0035         Outline, Filled, Flat
0036     };
0037     Q_ENUM(SegmentStyle)
0038 
0039     bool smallDecimalPoint() const;
0040     int digitCount() const;
0041     void setDigitCount(int nDigits);
0042 
0043     bool checkOverflow(double num) const;
0044     bool checkOverflow(int num) const;
0045 
0046     Mode mode() const;
0047     void setMode(Mode);
0048 
0049     SegmentStyle segmentStyle() const;
0050     void setSegmentStyle(SegmentStyle);
0051 
0052     double value() const;
0053     int intValue() const;
0054 
0055     QSize sizeHint() const override;
0056 
0057 public Q_SLOTS:
0058     void display(const QString &str);
0059     void display(int num);
0060     void display(double num);
0061     void setHexMode();
0062     void setDecMode();
0063     void setOctMode();
0064     void setBinMode();
0065     void setSmallDecimalPoint(bool);
0066 
0067 Q_SIGNALS:
0068     void overflow();
0069 
0070 protected:
0071     bool event(QEvent *e) override;
0072     void paintEvent(QPaintEvent *) override;
0073 
0074 public:
0075 
0076 private:
0077     Q_DISABLE_COPY(QLCDNumber)
0078     Q_DECLARE_PRIVATE(QLCDNumber)
0079 };
0080 
0081 QT_END_NAMESPACE
0082 
0083 #endif // QLCDNUMBER_H