diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-10-16 10:55:26 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-10-17 10:59:31 +0000 |
commit | b09bc0c0ebd8ff35ab5e77b21bd1fdd590347488 (patch) | |
tree | 59c058a6396b74583ce339946375d5fcddc13af8 /tests | |
parent | af4c0ee6c07f020e733574b1af99ab524bc41a9a (diff) |
QQmlAdaptorModel: return correct column count from the model
There is no reason for QQmlAdaptorModel to return the
wrong column count to the view. For models that are not
QAIM, the accessor that wraps the model will report the
column count to be 1 anyway. The same is also true
for QAbstractListModel.
Change-Id: Ia259b044201d76743e5f43d9f0999d3848912075
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquicktableview/testmodel.h | 1 | ||||
-rw-r--r-- | tests/auto/quick/qquicktableview/tst_qquicktableview.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktableview/testmodel.h b/tests/auto/quick/qquicktableview/testmodel.h index 28ea466b82..b1bb7a41b8 100644 --- a/tests/auto/quick/qquicktableview/testmodel.h +++ b/tests/auto/quick/qquicktableview/testmodel.h @@ -133,6 +133,7 @@ public: beginResetModel(); m_rows = 0; m_columns = 0; + modelData.clear(); endResetModel(); } diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp index 60b938d127..38789fd7bf 100644 --- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp +++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp @@ -1466,6 +1466,7 @@ void tst_QQuickTableView::modelSignals() QCOMPARE(tableView->columns(), 10); model.clear(); + model.setColumnCount(1); WAIT_UNTIL_POLISHED; QCOMPARE(tableView->rows(), 0); QCOMPARE(tableView->columns(), 1); |