From 2ef3ac72fc068b825f2185ab3682219dc7246464 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 13 Aug 2012 11:53:05 +0200 Subject: 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 Reviewed-by: Stephen Kelly --- .../itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/corelib/itemmodels') 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"); -- cgit v1.2.3