Reserve a virtual method for use with a feature in Qt 5.1.

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 <tmartsum@gmail.com>
Reviewed-by: David Faure <faure@kde.org>
bb10
Stephen Kelly 2012-03-19 12:16:12 +01:00 committed by Qt by Nokia
parent 8687cf1f99
commit fbdf76771c
2 changed files with 12 additions and 0 deletions

View File

@ -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<int> QAbstractItemDelegate::paintingRoles() const
{
return QSet<int>();
}
QT_END_NAMESPACE
#endif // QT_NO_ITEMVIEWS

View File

@ -114,6 +114,8 @@ public:
const QStyleOptionViewItem &option,
const QModelIndex &index);
virtual QSet<int> paintingRoles() const;
Q_SIGNALS:
void commitData(QWidget *editor);
void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint = NoHint);