Changeset View
Changeset View
Standalone View
Standalone View
src/editors/booledit.h
Show All 26 Lines | |||||
27 | 27 | | |||
28 | #include <QEvent> | 28 | #include <QEvent> | ||
29 | #include <QResizeEvent> | 29 | #include <QResizeEvent> | ||
30 | #include <QToolButton> | 30 | #include <QToolButton> | ||
31 | 31 | | |||
32 | //! A bool editor supporting two states: true and false. | 32 | //! A bool editor supporting two states: true and false. | ||
33 | /*! For null values, false is displayed. | 33 | /*! For null values, false is displayed. | ||
34 | */ | 34 | */ | ||
35 | class KPROPERTY_EXPORT KPropertyBoolEditor : public QToolButton | 35 | class KPROPERTYWIDGETS_EXPORT KPropertyBoolEditor : public QToolButton | ||
36 | { | 36 | { | ||
37 | Q_OBJECT | 37 | Q_OBJECT | ||
38 | Q_PROPERTY(bool value READ value WRITE setValue USER true) | 38 | Q_PROPERTY(bool value READ value WRITE setValue USER true) | ||
39 | 39 | | |||
40 | public: | 40 | public: | ||
41 | explicit KPropertyBoolEditor(const KProperty *prop, QWidget *parent = 0); | 41 | explicit KPropertyBoolEditor(const KProperty *prop, QWidget *parent = 0); | ||
42 | 42 | | |||
43 | ~KPropertyBoolEditor(); | 43 | ~KPropertyBoolEditor(); | ||
Show All 21 Lines | |||||
65 | private: | 65 | private: | ||
66 | QString m_yesText; | 66 | QString m_yesText; | ||
67 | QString m_noText; | 67 | QString m_noText; | ||
68 | }; | 68 | }; | ||
69 | 69 | | |||
70 | //! A bool editor supporting three states: true, false and null. | 70 | //! A bool editor supporting three states: true, false and null. | ||
71 | /*! The editor is implemented as a drop-down list. | 71 | /*! The editor is implemented as a drop-down list. | ||
72 | */ | 72 | */ | ||
73 | class KPROPERTY_EXPORT KPropertyThreeStateBoolEditor : public KPropertyComboBoxEditor | 73 | class KPROPERTYWIDGETS_EXPORT KPropertyThreeStateBoolEditor : public KPropertyComboBoxEditor | ||
74 | { | 74 | { | ||
75 | Q_OBJECT | 75 | Q_OBJECT | ||
76 | // Q_PROPERTY(QVariant value READ value WRITE setValue USER true) | 76 | // Q_PROPERTY(QVariant value READ value WRITE setValue USER true) | ||
77 | 77 | | |||
78 | public: | 78 | public: | ||
79 | explicit KPropertyThreeStateBoolEditor(const KPropertyListData& listData, QWidget *parent = 0); | 79 | explicit KPropertyThreeStateBoolEditor(const KPropertyListData& listData, QWidget *parent = 0); | ||
80 | ~KPropertyThreeStateBoolEditor(); | 80 | ~KPropertyThreeStateBoolEditor(); | ||
81 | 81 | | |||
82 | QVariant value() const; | 82 | QVariant value() const; | ||
83 | void setValue(const QVariant &value); | 83 | void setValue(const QVariant &value); | ||
84 | 84 | | |||
85 | Q_SIGNALS: | 85 | Q_SIGNALS: | ||
86 | void commitData( QWidget * editor ); | 86 | void commitData( QWidget * editor ); | ||
87 | }; | 87 | }; | ||
88 | 88 | | |||
89 | class KPROPERTY_EXPORT KPropertyBoolDelegate : public KPropertyEditorCreatorInterface, | 89 | class KPROPERTYWIDGETS_EXPORT KPropertyBoolDelegate : public KPropertyEditorCreatorInterface, | ||
90 | public KPropertyValuePainterInterface | 90 | public KPropertyValuePainterInterface | ||
91 | { | 91 | { | ||
92 | public: | 92 | public: | ||
93 | KPropertyBoolDelegate(); | 93 | KPropertyBoolDelegate(); | ||
94 | 94 | | |||
95 | virtual QWidget * createEditor( int type, QWidget *parent, | 95 | virtual QWidget * createEditor( int type, QWidget *parent, | ||
96 | const QStyleOptionViewItem & option, const QModelIndex & index ) const; | 96 | const QStyleOptionViewItem & option, const QModelIndex & index ) const; | ||
97 | 97 | | |||
98 | virtual void paint( QPainter * painter, | 98 | virtual void paint( QPainter * painter, | ||
99 | const QStyleOptionViewItem & option, const QModelIndex & index ) const; | 99 | const QStyleOptionViewItem & option, const QModelIndex & index ) const; | ||
100 | }; | 100 | }; | ||
101 | 101 | | |||
102 | #endif | 102 | #endif |