14 #include <QStringList>
20 #include <QDoubleSpinBox>
22 #include <QAbstractButton>
24 #include <QProgressBar>
35 virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime());
57 static void setSettingsValue(QSettings *settings, QString name, QVariant value);
58 static void writeSettings(QObject *
object, QSettings *settings, QString section);
59 static void readSettings(QObject *
object, QSettings *settings, QString section);
60 static void writeSettings(QObject *
object,
const QMetaObject *meta, QString groupName, QSettings *settings,
bool includeDynamic =
false);
61 static void readSettings(QObject *
object,
const QMetaObject *meta, QString groupName, QSettings *settings,
bool includeDynamic =
false);
62 static void writeSettings(QObject *
object, QString groupName, QSettings *settings,
bool includeDynamic =
false);
63 static void readSettings(QObject *
object, QString groupName, QSettings *settings,
bool includeDynamic =
false);
91 void linkTo(QDoubleSpinBox *spinBox);
92 void linkTo(QLabel *label);
93 void linkTo(QProgressBar *progress);
94 void linkTo(QLCDNumber *number);
120 void setValue(
double value,
int index);
139 void linkTo(QSpinBox *spinBox);
140 void linkTo(QComboBox *comboBox);
141 void linkTo(QLabel *label);
142 void linkTo(QProgressBar *progress);
143 void linkTo(QLCDNumber *number);
169 void setValue(
int value,
int index);
207 void linkTo(QAbstractButton *button);
236 void toggled(
bool value,
int index);
248 QString
value()
const;
251 void linkTo(QComboBox *comboBox);
252 void linkTo(QLineEdit *lineEdit);
253 void linkTo(QLabel *label);
254 void linkTo(QLCDNumber *number);
255 void linkTo(QTextEdit *number);
279 void setValue(QString value,
int index);
298 void setText(QString value,
int index);
317 void setText(QString value,
int index);
333 QDateTime
value()
const;
460 QStringList
value()
const;
462 QString
toString(
const QStringList &list);
485 QByteArray
value()
const;
487 QString
toString(
const QByteArray &list);
509 QPointF
value()
const;
513 void linkTo(QDoubleSpinBox *xSpinBox, QDoubleSpinBox *ySpinBox);
514 void linkTo(
int axis, QDoubleSpinBox *spinBox);
521 void setSubValue(
int axis,
double value,
int index);
541 void setSubValue(
int axis,
double value,
int index);
558 QRectF
value()
const;
604 qint64
value()
const;
629 #define QCEP_DOUBLE_PROPERTY(propname) \
631 double get_##propname() const \
633 return m_##propname.value(); \
636 void set_##propname(double val) \
638 m_##propname.setValue(val); \
641 double def_##propname() const \
643 return m_##propname.defaultValue(); \
646 void setdef_##propname(double val) \
648 m_##propname.setDefaultValue(val); \
651 void reset_##propname() \
653 m_##propname.resetValue(); \
656 QcepDoubleProperty *prop_##propname() { \
657 return &m_##propname; \
661 QcepDoubleProperty m_##propname;
664 #define QCEP_STRING_PROPERTY(propname) \
666 QString get_##propname() const \
668 return m_##propname.value(); \
671 void set_##propname(QString val) \
673 m_##propname.setValue(val); \
676 QString def_##propname() const \
678 return m_##propname.defaultValue(); \
681 void setdef_##propname(QString val) \
683 m_##propname.setDefaultValue(val); \
686 void reset_##propname() \
688 m_##propname.resetValue(); \
691 QcepStringProperty *prop_##propname() { \
692 return &m_##propname; \
696 QcepStringProperty m_##propname;
698 #define QCEP_INTEGER_PROPERTY(propname) \
700 int get_##propname() const \
702 return m_##propname.value(); \
705 void set_##propname(int val) \
707 m_##propname.setValue(val); \
710 int def_##propname() const \
712 return m_##propname.defaultValue(); \
715 void setdef_##propname(int val) \
717 m_##propname.setDefaultValue(val); \
720 void reset_##propname() \
722 m_##propname.resetValue(); \
725 QcepIntProperty *prop_##propname() { \
726 return &m_##propname; \
730 QcepIntProperty m_##propname;
732 #define QCEP_BOOLEAN_PROPERTY(propname) \
734 bool get_##propname() const \
736 return m_##propname.value(); \
739 void set_##propname(bool val) \
741 m_##propname.setValue(val); \
744 bool def_##propname() const \
746 return m_##propname.defaultValue(); \
749 void setdef_##propname(bool val) \
751 m_##propname.setDefaultValue(val); \
754 void reset_##propname() \
756 m_##propname.resetValue(); \
759 void toggle_##propname() \
761 m_##propname.toggle(); \
764 QcepBoolProperty *prop_##propname() { \
765 return &m_##propname; \
769 QcepBoolProperty m_##propname;
771 #define QCEP_DATETIME_PROPERTY(propname) \
773 QDateTime get_##propname() const \
775 return m_##propname.value(); \
778 void set_##propname(QDateTime val) \
780 m_##propname.setValue(val); \
783 QDateTime def_##propname() const \
785 return m_##propname.defaultValue(); \
788 void setdef_##propname(QDateTime val) \
790 m_##propname.setDefaultValue(val); \
793 void reset_##propname() \
795 m_##propname.resetValue(); \
798 QcepDateTimeProperty *prop_##propname() { \
799 return &m_##propname; \
803 QcepDateTimeProperty m_##propname;
805 #define QCEP_DOUBLE_LIST_PROPERTY(propname) \
807 QcepDoubleList get_##propname() const \
809 return m_##propname.value(); \
812 void set_##propname(QcepDoubleList val) \
814 m_##propname.setValue(val); \
817 QcepDoubleList def_##propname() const \
819 return m_##propname.defaultValue(); \
822 void setdef_##propname(QcepDoubleList val) \
824 m_##propname.setDefaultValue(val); \
827 void reset_##propname() \
829 m_##propname.resetValue(); \
832 QcepDoubleListProperty *prop_##propname() { \
833 return &m_##propname; \
837 QcepDoubleListProperty m_##propname;
839 #define QCEP_DOUBLE_VECTOR_PROPERTY(propname) \
841 QcepDoubleVector get_##propname() const \
843 return m_##propname.value(); \
846 void set_##propname(QcepDoubleVector val) \
848 m_##propname.setValue(val); \
851 QcepDoubleVector def_##propname() const \
853 return m_##propname.defaultValue(); \
856 void setdef_##propname(QcepDoubleVector val) \
858 m_##propname.setDefaultValue(val); \
861 void reset_##propname() \
863 m_##propname.resetValue(); \
866 QcepDoubleVectorProperty *prop_##propname() { \
867 return &m_##propname; \
871 QcepDoubleVectorProperty m_##propname;
873 #define QCEP_INTEGER_LIST_PROPERTY(propname) \
875 QcepIntList get_##propname() const \
877 return m_##propname.value(); \
880 void set_##propname(QcepIntList val) \
882 m_##propname.setValue(val); \
885 QcepIntList def_##propname() const \
887 return m_##propname.defaultValue(); \
890 void setdef_##propname(QcepIntList val) \
892 m_##propname.setDefaultValue(val); \
895 void reset_##propname() \
897 m_##propname.resetValue(); \
900 QcepIntListProperty *prop_##propname() { \
901 return &m_##propname; \
905 QcepIntListProperty m_##propname;
907 #define QCEP_INTEGER_VECTOR_PROPERTY(propname) \
909 QcepIntVector get_##propname() const \
911 return m_##propname.value(); \
914 void set_##propname(QcepIntVector val) \
916 m_##propname.setValue(val); \
919 QcepIntVector def_##propname() const \
921 return m_##propname.defaultValue(); \
924 void setdef_##propname(QcepIntVector val) \
926 m_##propname.setDefaultValue(val); \
929 void reset_##propname() \
931 m_##propname.resetValue(); \
934 QcepIntVectorProperty *prop_##propname() { \
935 return &m_##propname; \
939 QcepIntVectorProperty m_##propname;
941 #define QCEP_STRING_LIST_PROPERTY(propname) \
943 QStringList get_##propname() const \
945 return m_##propname.value(); \
948 void set_##propname(QStringList val) \
950 m_##propname.setValue(val); \
953 QcepStringList def_##propname() const \
955 return m_##propname.defaultValue(); \
958 void setdef_##propname(QStringList val) \
960 m_##propname.setDefaultValue(val); \
963 void reset_##propname() \
965 m_##propname.resetValue(); \
968 QcepStringListProperty *prop_##propname() { \
969 return &m_##propname; \
973 QcepStringListProperty m_##propname;
975 #define QCEP_BYTE_ARRAY_PROPERTY(propname) \
977 QByteArray get_##propname() const \
979 return m_##propname.value(); \
982 void set_##propname(QByteArray val) \
984 m_##propname.setValue(val); \
987 QByteArray def_##propname() const \
989 return m_##propname.defaultValue(); \
992 void setdef_##propname(QByteArray val) \
994 m_##propname.setDefaultValue(val); \
997 void reset_##propname() \
999 m_##propname.resetValue(); \
1002 QcepByteArrayProperty *prop_##propname() { \
1003 return &m_##propname; \
1007 QcepByteArrayProperty m_##propname;
1009 #define QCEP_DOUBLE_POINT_PROPERTY(propname) \
1011 QPointF get_##propname() const \
1013 return m_##propname.value(); \
1016 void set_##propname(QPointF val) \
1018 m_##propname.setValue(val); \
1021 QPointF def_##propname() const \
1023 return m_##propname.defaultValue(); \
1026 void setdef_##propname(QPointF val) \
1028 m_##propname.setDefaultValue(val); \
1031 void reset_##propname() \
1033 m_##propname.resetValue(); \
1036 QcepDoublePointProperty *prop_##propname() { \
1037 return &m_##propname; \
1041 QcepDoublePointProperty m_##propname;
1043 #define QCEP_DOUBLE_RECT_PROPERTY(propname) \
1045 QRectF get_##propname() const \
1047 return m_##propname.value(); \
1050 void set_##propname(QRectF val) \
1052 m_##propname.setValue(val); \
1055 QRectF def_##propname() const \
1057 return m_##propname.defaultValue(); \
1060 void setdef_##propname(QRectF val) \
1062 m_##propname.setDefaultValue(val); \
1065 void reset_##propname() \
1067 m_##propname.resetValue(); \
1070 QcepDoubleRectProperty *prop_##propname() { \
1071 return &m_##propname; \
1075 QcepDoubleRectProperty m_##propname;
1077 #define QCEP_POLYGON_PROPERTY(propname) \
1079 QcepPolygon get_##propname() const \
1081 return m_##propname.value(); \
1084 void set_##propname(QcepPolygon val) \
1086 m_##propname.setValue(val); \
1089 QcepPolygon def_##propname() const \
1091 return m_##propname.defaultValue(); \
1094 void setdef_##propname(QcepPolygon val) \
1096 m_##propname.setDefaultValue(val); \
1099 void reset_##propname() \
1101 m_##propname.resetValue(); \
1104 QcepPolygonProperty *prop_##propname() { \
1105 return &m_##propname; \
1109 QcepPolygonProperty m_##propname;
1111 #define QCEP_INTEGER64_PROPERTY(propname) \
1113 qint64 get_##propname() const \
1115 return m_##propname.value(); \
1118 void set_##propname(qint64 val) \
1120 m_##propname.setValue(val); \
1123 qint64 def_##propname() const \
1125 return m_##propname.defaultValue(); \
1128 void setdef_##propname(qint64 val) \
1130 m_##propname.setDefaultValue(val); \
1133 void reset_##propname() \
1135 m_##propname.resetValue(); \
1138 QcepInt64Property *prop_##propname() { \
1139 return &m_##propname; \
1143 QcepInt64Property m_##propname;
1145 #endif // QCEPPROPERTY_H
void setName(QString name)
QVector< int > QcepIntVector
void setCurrentIndex(int current)
void setSubValue(int axis, double value, int index)
double defaultValue() const
void currentIndexChanged(int value, int index)
void setDefaultValue(qint64 val)
void setValue(QcepIntVector val, int index)
void stringValueChanged(QString val)
QcepPolygon defaultValue() const
QcepIntList defaultValue() const
QRectF defaultValue() const
void appendValue(QPointF pt)
static void readSettings(QObject *object, QSettings *settings, QString section)
QcepStringPropertyLineEditHelper(QLineEdit *lineEdit, QcepStringProperty *property)
void setValue(int val, int index)
QcepIntList value() const
void valueChanged(QString val, int index)
void setWidgetToolTip(QWidget *widget)
void setValue(double value)
void setDefaultValue(QcepIntList val)
QcepStringPropertyTextEditHelper(QTextEdit *textEdit, QcepStringProperty *property)
void linkTo(QAbstractButton *button)
QcepDoubleProperty * m_Property
void setDefaultValue(int val)
void setValue(QString value, int index)
void textEdited(QString value, int index)
void valueChanged(QDateTime val, int index)
QcepDoubleVector defaultValue() const
void linkTo(QDoubleSpinBox *spinBox)
void setDefaultValue(QRectF val)
QByteArray defaultValue() const
void incValue(QcepIntVector step)
void setDefaultValue(QPointF val)
QPointF defaultValue() const
void setValue(QcepIntList val, int index)
QcepIntVectorProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QcepIntVector value, QString toolTip)
QcepDoubleListProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QcepDoubleList value, QString toolTip)
static void registerMetaTypes()
void incValue(QcepDoubleVector step)
void setValue(double val, int index)
void linkTo(QDoubleSpinBox *xSpinBox, QDoubleSpinBox *ySpinBox)
void setValue(QRectF val, int index)
QcepDoublePropertyDoubleSpinBoxHelper(QDoubleSpinBox *spinBox, QcepDoubleProperty *property)
QcepDoubleVectorProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QcepDoubleVector value, QString toolTip)
QcepPolygon value() const
void setValue(QDateTime val, int index)
QDoubleSpinBox * m_DoubleSpinBox
QcepInt64Property(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, qint64 value, QString toolTip)
void incValue(QcepDoubleList step)
void setSaver(QcepSettingsSaverWPtr saver)
void setValue(QStringList val, int index)
void setText(QString value, int index)
void setDefaultValue(QString val)
void valueChanged(QcepDoubleList val, int index)
void setDefaultValue(bool val)
void setDefaultValue(QDateTime val)
QcepBoolProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, bool value, QString toolTip)
QcepStringListProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QStringList value, QString toolTip)
void appendValue(double val)
void setValue(QcepPolygon val, int index)
void setValue(QcepDoubleVector val, int index)
void appendValue(double val)
QcepDoublePointProperty * m_Property
QString parentName() const
QDateTime defaultValue() const
QVector< double > QcepDoubleVector
void setSubValue(int axis, double value, int index)
QcepDoubleProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, double value, QString toolTip)
QString toString(const QcepDoubleList &list)
void valueChanged(QByteArray val, int index)
void setDefaultValue(double val)
QcepDateTimeProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QDateTime value, QString toolTip)
QcepStringPropertyComboBoxHelper(QComboBox *comboBox, QcepStringProperty *property)
void setValue(QcepDoubleList val, int index)
qint64 defaultValue() const
QcepDoubleVector m_Default
QcepDoubleVector value() const
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
static void writeSettings(QObject *object, QSettings *settings, QString section)
void valueChanged(QStringList val, int index)
void subValueChanged(int axis, double value, int index)
void setValue(bool val, int index)
void incValue(qint64 step)
QcepDoubleList defaultValue() const
void incValue(double step)
void textEdited(QString value, int index)
void linkTo(QComboBox *comboBox)
void setDefaultValue(QStringList val)
QcepStringProperty * m_Property
void valueChanged(QcepIntList val, int index)
QcepIntListProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QcepIntList value, QString toolTip)
QcepDoubleList value() const
void valueChanged(int value, int index)
void setDefaultValue(QByteArray val)
QcepIntProperty * m_Property
void setDefaultValue(QcepPolygon val)
QList< double > QcepDoubleList
QcepIntVector defaultValue() const
void linkTo(QSpinBox *spinBox)
QString toString(const QByteArray &list)
void valueChanged(QRectF val, int index)
QcepIntPropertySpinBoxHelper(QSpinBox *spinBox, QcepIntProperty *property)
void subValueChanged(int axis, double val, int index)
QcepDoublePointPropertyDoubleSpinBoxHelper(QDoubleSpinBox *spinBox, QcepDoublePointProperty *property, int axis)
QString toString(const QcepIntList &list)
void setValue(qint64 val, int index)
QcepProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
QcepIntPropertyComboBoxHelper(QComboBox *comboBox, QcepIntProperty *property)
void valueChanged(QString value, int index)
void setDefaultValue(QcepDoubleList val)
void setCurrentIndex(int value, int index)
QcepByteArrayProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QByteArray value, QString toolTip)
void valueChanged(qint64 val, int index)
QcepStringProperty * m_Property
QString toString(const QcepIntVector &list)
QcepIntVector value() const
QcepStringProperty * m_Property
QString toString(const QStringList &list)
QcepDoubleRectProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QRectF value, QString toolTip)
QStringList defaultValue() const
QDoubleSpinBox * m_DoubleSpinBox
double subValue(int axis) const
void stringValueChanged(QString val)
void appendValue(QString val)
void valueChanged(QcepDoubleVector val, int index)
QVector< QPointF > QcepPolygon
static void setSettingsValue(QSettings *settings, QString name, QVariant value)
void valueChanged(double value, int index)
void setDefaultValue(QcepDoubleVector val)
void setValue(QPointF val, int index)
QcepDoublePointProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QPointF value, QString toolTip)
static QMap< QString, CustomSettingsSaver * > m_CustomSavers
QString toString(const QcepDoubleVector &list)
void setValue(int value, int index)
void valueChanged(double val, int index)
void valueChanged(QcepIntVector val, int index)
QStringList value() const
void incValue(QcepIntList step)
void appendValue(int val)
void appendValue(int val)
QString defaultValue() const
bool defaultValue() const
QcepStringProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString value, QString toolTip)
void valueChanged(QPointF val, int index)
void valueChanged(int val, int index)
QString expandedToolTip() const
static void registerCustomSaver(QString typeName, CustomSettingsSaver *saver)
void stringValueChanged(QString val)
QcepIntProperty * m_Property
void setDefaultValue(QcepIntVector val)
void( CustomSettingsSaver)(const QVariant &val, QSettings *settings, QString name)
QcepIntProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, int value, QString toolTip)
void setValue(QByteArray val, int index)
void valueChanged(bool val, int index)
QcepPolygonProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QcepPolygon value, QString toolTip)
QWeakPointer< QcepSettingsSaver > QcepSettingsSaverWPtr
QcepSettingsSaverWPtr m_Saver
void setValue(QString val, int index)
void setToolTip(QString tip)
void valueChanged(QcepPolygon val, int index)
void setValue(double value, int index)