From 0edd2e39ad7f959c3d0c56e79abd3c60d9950538 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 11 Dec 2019 19:48:53 +0100 Subject: Let QItemSelectionModel::columnIntersectsSelection honor the parent QItemSelectionModel::columnIntersectsSelection() should honor the parent according to the docs. For rowIntersectsSelection() this was fixed a long time ago but columnIntersectsSelection() was forgotten. Sync the both functions and use range-based for loops as a drive-by. Fixes: QTBUG-80644 Change-Id: Iaf08f85e2225204d1e6564fa4bb0bc826352ed53 Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen --- .../itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp') diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp index c74101928a..80e5456306 100644 --- a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp +++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp @@ -2037,12 +2037,16 @@ void tst_QItemSelectionModel::rowIntersectsSelection3() QModelIndex parent; QVERIFY(!selectionModel.rowIntersectsSelection(0, parent)); + QVERIFY(!selectionModel.columnIntersectsSelection(0, parent)); parent = model.index(0, 0, parent); QVERIFY(selectionModel.rowIntersectsSelection(0, parent)); + QVERIFY(selectionModel.columnIntersectsSelection(0, parent)); parent = model.index(0, 0, parent); QVERIFY(!selectionModel.rowIntersectsSelection(0, parent)); + QVERIFY(!selectionModel.columnIntersectsSelection(0, parent)); parent = model.index(0, 0, parent); QVERIFY(!selectionModel.rowIntersectsSelection(0, parent)); + QVERIFY(!selectionModel.columnIntersectsSelection(0, parent)); } void tst_QItemSelectionModel::unselectable() -- cgit v1.2.3