From fbdf76771c50294f0a1c0b450f50affc2100b30a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 19 Mar 2012 12:16:12 +0100 Subject: Reserve a virtual method for use with a feature in Qt 5.1. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The view will query the delegate for roles which are relevant to the particular delegate. For unrelated roles, the delegate will not have to repaint when the data changes. Change-Id: If8f1ba4c2bce7dbcf70de344b984aea1deca0edd Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: David Faure --- src/widgets/itemviews/qabstractitemdelegate.cpp | 10 ++++++++++ src/widgets/itemviews/qabstractitemdelegate.h | 2 ++ 2 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp index ecba3e238f..125beab91b 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.cpp +++ b/src/widgets/itemviews/qabstractitemdelegate.cpp @@ -402,6 +402,16 @@ bool QAbstractItemDelegate::helpEvent(QHelpEvent *event, return false; } +/*! + \internal + + This virtual method is reserved and will be used in Qt 5.1. +*/ +QSet QAbstractItemDelegate::paintingRoles() const +{ + return QSet(); +} + QT_END_NAMESPACE #endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qabstractitemdelegate.h b/src/widgets/itemviews/qabstractitemdelegate.h index 2c51dfcac8..89aa1915f6 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.h +++ b/src/widgets/itemviews/qabstractitemdelegate.h @@ -114,6 +114,8 @@ public: const QStyleOptionViewItem &option, const QModelIndex &index); + virtual QSet paintingRoles() const; + Q_SIGNALS: void commitData(QWidget *editor); void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint = NoHint); -- cgit v1.2.3