summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/itemmodels
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-08-13 11:53:05 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-18 08:34:53 +0200
commit2ef3ac72fc068b825f2185ab3682219dc7246464 (patch)
treeef08dbea5c53c950a22fe8752ec4b2f0f3d990ab /tests/auto/corelib/itemmodels
parent72604f8eb9e0cab8e0de8f30576af11aebaf3e11 (diff)
Emit layoutChange signals when changing QPersistentModelIndexes.
This is necessary whenever QPersistentModelIndexes are changed. Omitting it means that views are not able to react to the change, such as QTreeView clearing its (manually held) QModelIndex cache, and the QItemSelectionModel clearing the item from its storage. It is necessary to change a QSortFilterProxyModel test which assumed setItem does not have any such effect. That test is ported to setData instead. Task-number: QTBUG-18539 Change-Id: Id7a602f18b9773ba4d11019418de886860d26d3e Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'tests/auto/corelib/itemmodels')
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index 444d26ce33..7f141bdab0 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
@@ -2496,7 +2496,7 @@ void tst_QSortFilterProxyModel::staticSorting()
}
//update one item.
- model.setItem(0, 0, new QStandardItem("girafe"));
+ items.first()->setData("girafe", Qt::DisplayRole);
// make sure the proxy is updated but not sorted
expected.replaceInStrings("bateau", "girafe");