diff options
author | Liang Qi <liang.qi@qt.io> | 2019-08-27 09:45:52 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-08-27 09:45:52 +0200 |
commit | 0f1f7fb97fd0dd572ad61a0ebaef68c2bba72e57 (patch) | |
tree | e1f3f1b58aa69904e6bc629e88ed68fca858f83a /tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp | |
parent | e8c70fb07f01b492b721451c00496f860eb40be0 (diff) | |
parent | 5bb178c479a247720fbc3fbb7f06a32b725193ac (diff) |
Merge remote-tracking branch 'origin/dev' into 5.14
Conflicts:
src/widgets/kernel/qwidget.cpp
src/widgets/kernel/qwidget_p.h
src/widgets/kernel/qwidgetrepaintmanager.cpp
src/widgets/kernel/qwidgetwindow.cpp
tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
Change-Id: Ifae457d0427be8e2465e474b055722e11b3b1e5c
Diffstat (limited to 'tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp')
-rw-r--r-- | tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp index 0f7588a71a..624187349b 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp @@ -829,7 +829,7 @@ void tst_QSortFilterProxyModel::removeRows_data() void tst_QSortFilterProxyModel::removeRows() { - QFETCH(QStringList, initial); + QFETCH(const QStringList, initial); QFETCH(int, sortOrder); QFETCH(QString, filter); QFETCH(int, position); @@ -843,7 +843,7 @@ void tst_QSortFilterProxyModel::removeRows() proxy.setSourceModel(&model); // prepare model - foreach (QString s, initial) + for (const auto &s : initial) model.appendRow(new QStandardItem(s)); if (sortOrder != -1) @@ -3035,15 +3035,15 @@ void tst_QSortFilterProxyModel::removeRowsRecursive() QList<QPersistentModelIndex> sourceIndexes; QList<QPersistentModelIndex> proxyIndexes; - foreach (QStandardItem *item, items) { + for (const auto item : qAsConst(items)) { QModelIndex idx = item->index(); sourceIndexes << idx; proxyIndexes << proxy.mapFromSource(idx); } - foreach (const QPersistentModelIndex &pidx, sourceIndexes) + for (const auto &pidx : qAsConst(sourceIndexes)) QVERIFY(pidx.isValid()); - foreach (const QPersistentModelIndex &pidx, proxyIndexes) + for (const auto &pidx : qAsConst(proxyIndexes)) QVERIFY(pidx.isValid()); QList<QStandardItem*> itemRow = pItem1->takeRow(0); @@ -3051,9 +3051,9 @@ void tst_QSortFilterProxyModel::removeRowsRecursive() QCOMPARE(itemRow.count(), 1); QCOMPARE(itemRow.first(), pItem11); - foreach (const QPersistentModelIndex &pidx, sourceIndexes) + for (const auto &pidx : qAsConst(sourceIndexes)) QVERIFY(!pidx.isValid()); - foreach (const QPersistentModelIndex &pidx, proxyIndexes) + for (const auto &pidx : qAsConst(proxyIndexes)) QVERIFY(!pidx.isValid()); delete pItem11; @@ -3280,10 +3280,8 @@ void tst_QSortFilterProxyModel::testMultipleProxiesWithSelection() static bool isValid(const QItemSelection &selection) { - foreach (const QItemSelectionRange &range, selection) - if (!range.isValid()) - return false; - return true; + return std::all_of(selection.begin(), selection.end(), + [](const QItemSelectionRange &range) { return range.isValid(); }); } void tst_QSortFilterProxyModel::mapSelectionFromSource() @@ -3737,14 +3735,16 @@ void tst_QSortFilterProxyModel::testParentLayoutChanged() QVERIFY(beforeParents.first() == proxy.mapFromSource(model.indexFromItem(model.invisibleRootItem()->child(1)))); - QList<QPersistentModelIndex> proxy2BeforeList = proxy2ParentsAboutToBeChangedSpy.first().first().value<QList<QPersistentModelIndex> >(); - QList<QPersistentModelIndex> proxy2AfterList = proxy2ParentsChangedSpy.first().first().value<QList<QPersistentModelIndex> >(); + const QList<QPersistentModelIndex> proxy2BeforeList = + proxy2ParentsAboutToBeChangedSpy.first().first().value<QList<QPersistentModelIndex> >(); + const QList<QPersistentModelIndex> proxy2AfterList = + proxy2ParentsChangedSpy.first().first().value<QList<QPersistentModelIndex> >(); QCOMPARE(proxy2BeforeList.size(), beforeParents.size()); QCOMPARE(proxy2AfterList.size(), afterParents.size()); - foreach (const QPersistentModelIndex &idx, proxy2BeforeList) + for (const QPersistentModelIndex &idx : proxy2BeforeList) QVERIFY(beforeParents.contains(proxy2.mapToSource(idx))); - foreach (const QPersistentModelIndex &idx, proxy2AfterList) + for (const QPersistentModelIndex &idx : proxy2AfterList) QVERIFY(afterParents.contains(proxy2.mapToSource(idx))); } |