diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-10-26 14:42:52 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-10-28 15:27:37 +0100 |
commit | 07ff70a0da189656daf31c2a5e3e3ba117762af3 (patch) | |
tree | cc633b36727f4d166112a250733a44026997b090 /tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp | |
parent | 29c113d912fdf96f99503c9635bf89c4cabcc6fb (diff) |
Remove QItemSelectionRange's operator<()
As advocated in a ### Qt 6 comment.
[ChangeLog][QtCore][QItemSelectionRange] QItemSelectionRange no longer
supports ordering. The prior ordering was inconsistent with equality
and should not be needed.
Task-number: QTBUG-85700
Change-Id: I5eb372c203cae19db40fa67f706d911785652d5f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp')
-rw-r--r-- | tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp | 141 |
1 files changed, 0 insertions, 141 deletions
diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp index e9bc0581be..35b70ee103 100644 --- a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp +++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp @@ -82,10 +82,6 @@ private slots: void layoutChangedWithAllSelected2(); void layoutChangedTreeSelection(); void deselectRemovedMiddleRange(); -#if QT_DEPRECATED_SINCE(5, 15) - void rangeOperatorLessThan_data(); - void rangeOperatorLessThan(); -#endif void setModel(); void testDifferentModels(); @@ -2447,143 +2443,6 @@ static QStandardItemModel* getModel(QObject *parent) return model; } -#if QT_DEPRECATED_SINCE(5, 15) -enum Result { - LessThan, - NotLessThan, - NotEqual -}; - -Q_DECLARE_METATYPE(Result); - -void tst_QItemSelectionModel::rangeOperatorLessThan_data() -{ - QTest::addColumn<int>("parent1"); - QTest::addColumn<int>("top1"); - QTest::addColumn<int>("left1"); - QTest::addColumn<int>("bottom1"); - QTest::addColumn<int>("right1"); - QTest::addColumn<int>("parent2"); - QTest::addColumn<int>("top2"); - QTest::addColumn<int>("left2"); - QTest::addColumn<int>("bottom2"); - QTest::addColumn<int>("right2"); - QTest::addColumn<Result>("result"); - - QTest::newRow("lt01") << -1 << 0 << 0 << 3 << 3 - << -1 << 0 << 0 << 3 << 3 << NotLessThan; - - QTest::newRow("lt02") << -1 << 0 << 0 << 2 << 3 - << -1 << 0 << 0 << 3 << 3 << LessThan; - QTest::newRow("lt03") << -1 << 0 << 0 << 3 << 2 - << -1 << 0 << 0 << 3 << 3 << LessThan; - QTest::newRow("lt04") << -1 << 0 << 0 << 2 << 2 - << -1 << 0 << 0 << 3 << 3 << LessThan; - - QTest::newRow("lt05") << -1 << 0 << 0 << 3 << 3 - << -1 << 0 << 0 << 2 << 3 << NotLessThan; - QTest::newRow("lt06") << -1 << 0 << 0 << 3 << 3 - << -1 << 0 << 0 << 3 << 2 << NotLessThan; - QTest::newRow("lt07") << -1 << 0 << 0 << 3 << 3 - << -1 << 0 << 0 << 2 << 2 << NotLessThan; - - QTest::newRow("lt08") << -1 << 0 << 0 << 3 << 3 - << 0 << 0 << 0 << 3 << 3 << NotEqual; - QTest::newRow("lt09") << 1 << 0 << 0 << 3 << 3 - << 0 << 0 << 0 << 3 << 3 << NotEqual; - QTest::newRow("lt10") << 1 << 0 << 0 << 1 << 1 - << 0 << 2 << 2 << 3 << 3 << NotEqual; - QTest::newRow("lt11") << 1 << 2 << 2 << 3 << 3 - << 0 << 0 << 0 << 1 << 1 << NotEqual; - - QTest::newRow("lt12") << -1 << 0 << 0 << 1 << 1 - << -1 << 2 << 2 << 3 << 3 << LessThan; - QTest::newRow("lt13") << -1 << 2 << 2 << 3 << 3 - << -1 << 0 << 0 << 1 << 1 << NotLessThan; - QTest::newRow("lt14") << 1 << 0 << 0 << 1 << 1 - << 1 << 2 << 2 << 3 << 3 << LessThan; - QTest::newRow("lt15") << 1 << 2 << 2 << 3 << 3 - << 1 << 0 << 0 << 1 << 1 << NotLessThan; - - QTest::newRow("lt16") << -1 << 0 << 0 << 2 << 2 - << -1 << 1 << 1 << 3 << 3 << LessThan; - QTest::newRow("lt17") << -1 << 1 << 1 << 3 << 3 - << -1 << 0 << 0 << 2 << 2 << NotLessThan; - QTest::newRow("lt18") << 1 << 0 << 0 << 2 << 2 - << 1 << 1 << 1 << 3 << 3 << LessThan; - QTest::newRow("lt19") << 1 << 1 << 1 << 3 << 3 - << 1 << 0 << 0 << 2 << 2 << NotLessThan; -} - -void tst_QItemSelectionModel::rangeOperatorLessThan() -{ - QStandardItemModel *model1 = getModel(this); - QStandardItemModel *model2 = getModel(this); - - QFETCH(int, parent1); - QFETCH(int, top1); - QFETCH(int, left1); - QFETCH(int, bottom1); - QFETCH(int, right1); - QFETCH(int, parent2); - QFETCH(int, top2); - QFETCH(int, left2); - QFETCH(int, bottom2); - QFETCH(int, right2); - QFETCH(Result, result); - - QModelIndex p1 = model1->index(parent1, 0); - - QModelIndex tl1 = model1->index(top1, left1, p1); - QModelIndex br1 = model1->index(bottom1, right1, p1); - - QItemSelectionRange r1(tl1, br1); - - QModelIndex p2 = model1->index(parent2, 0); - - QModelIndex tl2 = model1->index(top2, left2, p2); - QModelIndex br2 = model1->index(bottom2, right2, p2); - - QItemSelectionRange r2(tl2, br2); - - if (result == LessThan) - QVERIFY(r1 < r2); - else if (result == NotLessThan) - QVERIFY(!(r1 < r2)); - else if (result == NotEqual) - if (!(r1 < r2)) - QVERIFY(r2 < r1); - - // Ranges in different models are always non-equal - - QModelIndex p3 = model2->index(parent1, 0); - - QModelIndex tl3 = model2->index(top1, left1, p3); - QModelIndex br3 = model2->index(bottom1, right1, p3); - - QItemSelectionRange r3(tl3, br3); - - if (!(r1 < r3)) - QVERIFY(r3 < r1); - - if (!(r2 < r3)) - QVERIFY(r3 < r2); - - QModelIndex p4 = model2->index(parent2, 0); - - QModelIndex tl4 = model2->index(top2, left2, p4); - QModelIndex br4 = model2->index(bottom2, right2, p4); - - QItemSelectionRange r4(tl4, br4); - - if (!(r1 < r4)) - QVERIFY(r4 < r1); - - if (!(r2 < r4)) - QVERIFY(r4 < r2); -} -#endif - void tst_QItemSelectionModel::setModel() { QItemSelectionModel sel; |