summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2011-12-20 12:56:01 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-02 16:43:02 +0100
commitf29e55448b8e0c0a156e3af960589c6733cc4d7d (patch)
tree68ace1683067cea9895fa8171cd8c56ef77e47fb /tests/auto
parenta23a5487eb60c0f8b3c99d32a5e8e3cf636e4911 (diff)
downloadqtbase-f29e55448b8e0c0a156e3af960589c6733cc4d7d.tar.gz
Change the default value of QSortFilterProxyModel::dynamicSortFilter
The value is changed to true. It is a common bug that developers expect this proxy model to reflect the source model when the source changes. That requires setDynamicSortFilter(true), so we change the default to optimize for the common case. Change-Id: I9bf7efdbda10309fa77aed9391c33054aaae4a29 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp2
-rw-r--r--tests/auto/corelib/kernel/qitemmodel/modelstotest.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index 7b591be8cc..67b55a92e7 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
@@ -2518,6 +2518,7 @@ void tst_QSortFilterProxyModel::dynamicSorting()
const QStringList initial = QString("bateau avion dragon hirondelle flamme camion elephant").split(" ");
model1.setStringList(initial);
QSortFilterProxyModel proxy1;
+ proxy1.setDynamicSortFilter(false);
proxy1.sort(0);
proxy1.setSourceModel(&model1);
@@ -2563,7 +2564,6 @@ void tst_QSortFilterProxyModel::dynamicSorting()
//set up the sorting before seting the model up
QSortFilterProxyModel proxy2;
- proxy2.setDynamicSortFilter(true);
proxy2.sort(0);
proxy2.setSourceModel(&model2);
for (int row = 0; row < proxy2.rowCount(QModelIndex()); ++row) {
diff --git a/tests/auto/corelib/kernel/qitemmodel/modelstotest.cpp b/tests/auto/corelib/kernel/qitemmodel/modelstotest.cpp
index 496789d408..67d5024944 100644
--- a/tests/auto/corelib/kernel/qitemmodel/modelstotest.cpp
+++ b/tests/auto/corelib/kernel/qitemmodel/modelstotest.cpp
@@ -163,7 +163,7 @@ QAbstractItemModel *ModelsToTest::createModel(const QString &modelType)
QStandardItemModel *standardItemModel = new QStandardItemModel;
model->setSourceModel(standardItemModel);
populateTestArea(model);
- model->setFilterRegExp(QRegExp("(^$|0.*)"));
+ model->setFilterRegExp(QRegExp("(^$|I.*)"));
return model;
}