diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-03-21 20:41:57 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-28 02:01:49 +0200 |
commit | c3e1abad4e141e6e9d876e5cff194c473a2654eb (patch) | |
tree | 6878ee94b8901d402332a027e7081631f8ddcba6 /src/widgets/widgets/qdatetimeedit.h | |
parent | e7a6dacf805602eb76786244da76dae29624bfb7 (diff) |
Add USER properties to QDateEdit and QTimeEdit.
Both classes had such components before, but there were issues with
the NOTIFY signal not being in the same class as the Q_PROPERTY.
This patch solves that problem by using a signal of a different name.
Task-number: QTBUG-15731
Change-Id: Ibc7ce4dba8a6b88c05d62a90e14d0101c5cd3082
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Diffstat (limited to 'src/widgets/widgets/qdatetimeedit.h')
-rw-r--r-- | src/widgets/widgets/qdatetimeedit.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/widgets/qdatetimeedit.h b/src/widgets/widgets/qdatetimeedit.h index ffb8503d5e..07fc2b04fb 100644 --- a/src/widgets/widgets/qdatetimeedit.h +++ b/src/widgets/widgets/qdatetimeedit.h @@ -205,17 +205,25 @@ private: class Q_WIDGETS_EXPORT QTimeEdit : public QDateTimeEdit { Q_OBJECT + Q_PROPERTY(QTime time READ time WRITE setTime NOTIFY userTimeChanged USER true) public: QTimeEdit(QWidget *parent = 0); QTimeEdit(const QTime &time, QWidget *parent = 0); + +Q_SIGNALS: + void userTimeChanged(const QTime &time); }; class Q_WIDGETS_EXPORT QDateEdit : public QDateTimeEdit { Q_OBJECT + Q_PROPERTY(QDate date READ date WRITE setDate NOTIFY userDateChanged USER true) public: QDateEdit(QWidget *parent = 0); QDateEdit(const QDate &date, QWidget *parent = 0); + +Q_SIGNALS: + void userDateChanged(const QDate &date); }; Q_DECLARE_OPERATORS_FOR_FLAGS(QDateTimeEdit::Sections) |