|
Canorus
0.7
|
00001 00024 #ifndef NUMBERDISPLAY_H 00025 00026 #define NUMBERDISPLAY_H 00027 00028 #include <QLCDNumber> 00029 #include <QContextMenuEvent> 00030 00031 class QAction; 00032 00033 // LCD Number enhanced with the possibility to limit the number displayed in the LCD 00034 class CALCDNumber : public QLCDNumber 00035 { 00036 Q_OBJECT 00037 00038 public: 00050 CALCDNumber (int iMin, int iMax, QWidget * poParent=0, QString oText = ""); 00051 00058 void setRealValue(int val); 00063 int getRealValue(); 00070 void setMin(int iMin); 00077 void setMax(int iMax); 00082 bool isZero(); 00083 signals: 00090 void valChanged(int iVal); 00091 protected: 00098 virtual void mousePressEvent(QMouseEvent *poEvt); 00105 virtual void wheelEvent(QWheelEvent *poEvt); 00106 00113 virtual inline void contextMenuEvent(QContextMenuEvent *poEvt) { } 00114 private: 00115 int min_, max_; 00116 QAction *numDisplay_; 00117 int realValue_; 00118 QString toolTipText_; 00119 }; 00120 00121 #endif /* NUMBERDISPLAY_H */
1.8.0