Changeset View
Changeset View
Standalone View
Standalone View
src/editors/datetimeedit.h
Show All 16 Lines | 1 | /* This file is part of the KDE project | |||
---|---|---|---|---|---|
17 | along with this library; see the file COPYING.LIB. If not, write to | 17 | along with this library; see the file COPYING.LIB. If not, write to | ||
18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
19 | * Boston, MA 02110-1301, USA. | 19 | * Boston, MA 02110-1301, USA. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef KPROPERTY_DATETIMEEDIT_H | 22 | #ifndef KPROPERTY_DATETIMEEDIT_H | ||
23 | #define KPROPERTY_DATETIMEEDIT_H | 23 | #define KPROPERTY_DATETIMEEDIT_H | ||
24 | 24 | | |||
25 | #include "KPropertyFactory.h" | 25 | #include "KPropertyWidgetsFactory.h" | ||
26 | #include <QDateTimeEdit> | 26 | #include <QDateTimeEdit> | ||
27 | 27 | | |||
28 | class KPROPERTY_EXPORT KPropertyDateTimeEditor : public QDateTimeEdit | 28 | class KPROPERTYWIDGETS_EXPORT KPropertyDateTimeEditor : public QDateTimeEdit | ||
29 | { | 29 | { | ||
30 | Q_OBJECT | 30 | Q_OBJECT | ||
31 | Q_PROPERTY(QVariant value READ value WRITE setValue USER true) | 31 | Q_PROPERTY(QVariant value READ value WRITE setValue USER true) | ||
32 | 32 | | |||
33 | public: | 33 | public: | ||
34 | KPropertyDateTimeEditor(const KProperty* prop, QWidget* parent); | 34 | KPropertyDateTimeEditor(const KProperty* prop, QWidget* parent); | ||
35 | virtual ~KPropertyDateTimeEditor(); | 35 | virtual ~KPropertyDateTimeEditor(); | ||
36 | 36 | | |||
37 | QVariant value() const; | 37 | QVariant value() const; | ||
38 | 38 | | |||
39 | Q_SIGNALS: | 39 | Q_SIGNALS: | ||
40 | void commitData(QWidget* editor); | 40 | void commitData(QWidget* editor); | ||
41 | 41 | | |||
42 | public Q_SLOTS: | 42 | public Q_SLOTS: | ||
43 | void setValue(const QVariant& value); | 43 | void setValue(const QVariant& value); | ||
44 | 44 | | |||
45 | protected: | 45 | protected: | ||
46 | virtual void paintEvent(QPaintEvent* event); | 46 | virtual void paintEvent(QPaintEvent* event); | ||
47 | 47 | | |||
48 | protected Q_SLOTS: | 48 | protected Q_SLOTS: | ||
49 | void onDateTimeChanged(); | 49 | void onDateTimeChanged(); | ||
50 | }; | 50 | }; | ||
51 | 51 | | |||
52 | class KPROPERTY_EXPORT KPropertyDateTimeDelegate : public KPropertyEditorCreatorInterface, | 52 | class KPROPERTYWIDGETS_EXPORT KPropertyDateTimeDelegate : public KPropertyEditorCreatorInterface, | ||
53 | public KPropertyValueDisplayInterface | 53 | public KPropertyValueDisplayInterface | ||
54 | { | 54 | { | ||
55 | public: | 55 | public: | ||
56 | KPropertyDateTimeDelegate(); | 56 | KPropertyDateTimeDelegate(); | ||
57 | 57 | | |||
58 | virtual QString displayTextForProperty(const KProperty* prop) const; | 58 | virtual QString displayTextForProperty(const KProperty* prop) const; | ||
59 | 59 | | |||
60 | virtual QWidget* createEditor(int type, QWidget* parent, | 60 | virtual QWidget* createEditor(int type, QWidget* parent, | ||
61 | const QStyleOptionViewItem& option, const QModelIndex& index) const; | 61 | const QStyleOptionViewItem& option, const QModelIndex& index) const; | ||
62 | }; | 62 | }; | ||
63 | 63 | | |||
64 | #endif | 64 | #endif |