Clarify behavior of setData in QListWidget, QTableWidget, and QTreeWidget

setData()'s default implementation for QListWidget, QTableWidget, and
QTreeWidget treats Qt::EditRole and Qt::DisplayRole as referring to the
same data. Used the same sentence from QStandardItem::setData for
consistency.

Task-number: QTBUG-11549
Change-Id: I41d06bdaaa8e7d4a86e24147b3d8222ad7823a6c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
bb10
Kavindra Palaraja 2017-01-09 21:51:54 +01:00 committed by David Faure
parent 43e444d1ff
commit 6ff8d8173d
3 changed files with 9 additions and 0 deletions

View File

@ -690,6 +690,9 @@ QListWidgetItem *QListWidgetItem::clone() const
Sets the data for a given \a role to the given \a value. Reimplement this
function if you need extra roles or special behavior for certain roles.
\note The default implementation treats Qt::EditRole and Qt::DisplayRole as
referring to the same data.
\sa Qt::ItemDataRole, data()
*/
void QListWidgetItem::setData(int role, const QVariant &value)

View File

@ -1365,6 +1365,9 @@ QTableWidgetItem *QTableWidgetItem::clone() const
/*!
Sets the item's data for the given \a role to the specified \a value.
\note The default implementation treats Qt::EditRole and Qt::DisplayRole as
referring to the same data.
\sa Qt::ItemDataRole, data()
*/
void QTableWidgetItem::setData(int role, const QVariant &value)

View File

@ -1699,6 +1699,9 @@ Qt::ItemFlags QTreeWidgetItem::flags() const
The \a role describes the type of data specified by \a value, and is defined by
the Qt::ItemDataRole enum.
\note The default implementation treats Qt::EditRole and Qt::DisplayRole as
referring to the same data.
*/
void QTreeWidgetItem::setData(int column, int role, const QVariant &value)
{