Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef PROPERTYVALUE_H
00029 #define PROPERTYVALUE_H
00030
00031 #include <QtGui>
00032
00033 #include "QGpGuiToolsDLLExport.h"
00034
00035 namespace QGpGuiTools {
00036
00037 class QGPGUITOOLS_EXPORT PropertyValue : public QObject
00038 {
00039 Q_OBJECT
00040 public:
00041 PropertyValue(int id, QWidget * w, QWidget * label, int widgetType);
00042
00043 QWidget * widget() const {return _widget;}
00044 QWidget * label() const {return _label;}
00045 int widgetType() const {return _widgetType;}
00046 int id() const {return _id;}
00047
00048 void setValue(QVariant val);
00049 void reset();
00050
00051 void freeze(bool f) {_frozen=f;}
00052 bool isFrozen() const {return _frozen;}
00053
00054 QVariant value() const {return _value;}
00055 bool constant() const {return _constant;}
00056
00057 bool isTouched() const {return _touched;}
00058 void setTouched(bool t=true) {_touched=t;}
00059 public slots:
00060 void touched();
00061 signals:
00062 void constantChanged(bool c);
00063 void touched(PropertyValue * p);
00064 private:
00065 int _id;
00066 QWidget * _widget;
00067 QWidget * _label;
00068 int _widgetType;
00069 uint _constant:1;
00070 uint _frozen:1;
00071 uint _touched:1;
00072 QVariant _value;
00073 };
00074
00075 inline void PropertyValue::touched()
00076 {
00077 if(!_frozen) {
00078 _touched=true;
00079 emit touched(this);
00080 reset();
00081 }
00082 }
00083
00084 }
00085
00086 #endif // PROPERTYVALUE_H