diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2023-08-07 11:59:54 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2023-09-20 10:48:21 +0200 |
commit | 82d0d8321a02f46732489b5fedc8e77e56523c3d (patch) | |
tree | aa01fa7dbfb881ddafa39c362d953ee5a0c70fec /tests/auto/quick/qquicktableview/tst_qquicktableview.cpp | |
parent | 3c633dc1e060c30fd90db7b4740bbc2deb5588b1 (diff) |
QQuickTableView: let the subclass decide which model to use for selections
When a subclass that has a proxy model is in use, it's not given
if the selection model should be using the application model
or the proxy model to store selections. Rather, this is subclass
specific. In case of TreeView, the application model should
be used. In case of HeaderView, the proxy model should be
used. Until now, we always used the application model, which
would fail if trying to select cells in HeaderView. The reason
for the latter is that the proxy model in HeaderView doesn't
share any common model items with the application model, and
therefore cannot use the application model for selections.
Fixes: QTBUG-115227
Pick-to: 6.6 6.5 6.2
Change-Id: I39f0687e0396392039234787fda0df6d7d4d7da4
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicktableview/tst_qquicktableview.cpp')
-rw-r--r-- | tests/auto/quick/qquicktableview/tst_qquicktableview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp index fe27b374f5..e0c4c1c690 100644 --- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp +++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp @@ -4394,7 +4394,7 @@ void tst_QQuickTableView::warnOnWrongModelInSelectionModel() selectionModel.setModel(&model2); // And change currentIndex. This will produce a warning. - QTest::ignoreMessage(QtWarningMsg, QRegularExpression(".*model differs.*")); + QTest::ignoreMessage(QtWarningMsg, QRegularExpression(".*TableView.selectionModel.model.*")); selectionModel.setCurrentIndex(model2.index(0, 0), QItemSelectionModel::NoUpdate); } |