From c3e1abad4e141e6e9d876e5cff194c473a2654eb Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 21 Mar 2012 20:41:57 +0100 Subject: Add USER properties to QDateEdit and QTimeEdit. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Thorbjørn Lund Martsum --- src/widgets/itemviews/qitemdelegate.cpp | 12 ------------ src/widgets/itemviews/qstyleditemdelegate.cpp | 12 ------------ 2 files changed, 24 deletions(-) (limited to 'src/widgets/itemviews') diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp index 419c62ff65..6c62378009 100644 --- a/src/widgets/itemviews/qitemdelegate.cpp +++ b/src/widgets/itemviews/qitemdelegate.cpp @@ -555,18 +555,6 @@ void QItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index) con QVariant v = index.data(Qt::EditRole); QByteArray n = editor->metaObject()->userProperty().name(); - // ### Qt 5: remove - // A work-around for missing "USER true" in qdatetimeedit.h for - // QTimeEdit's time property and QDateEdit's date property. - // It only triggers if the default user property "dateTime" is - // reported for QTimeEdit and QDateEdit. - if (n == "dateTime") { - if (editor->inherits("QTimeEdit")) - n = "time"; - else if (editor->inherits("QDateEdit")) - n = "date"; - } - // ### Qt 5: give QComboBox a USER property if (n.isEmpty() && editor->inherits("QComboBox")) n = d->editorFactory()->valuePropertyName(v.userType()); diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp index 93893afaa8..b27dcb0a7b 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.cpp +++ b/src/widgets/itemviews/qstyleditemdelegate.cpp @@ -492,18 +492,6 @@ void QStyledItemDelegate::setEditorData(QWidget *editor, const QModelIndex &inde QVariant v = index.data(Qt::EditRole); QByteArray n = editor->metaObject()->userProperty().name(); - // ### Qt 5: remove - // A work-around for missing "USER true" in qdatetimeedit.h for - // QTimeEdit's time property and QDateEdit's date property. - // It only triggers if the default user property "dateTime" is - // reported for QTimeEdit and QDateEdit. - if (n == "dateTime") { - if (editor->inherits("QTimeEdit")) - n = "time"; - else if (editor->inherits("QDateEdit")) - n = "date"; - } - // ### Qt 5: give QComboBox a USER property if (n.isEmpty() && editor->inherits("QComboBox")) n = d->editorFactory()->valuePropertyName(v.userType()); -- cgit v1.2.3