diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2019-12-05 14:53:55 +0100 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2019-12-09 14:16:07 +0100 |
commit | e1cc06972a42e2bae51b027737919445d0e675f7 (patch) | |
tree | 086634c598fa5e4ed5cac28c9f05c446d173601e /tests | |
parent | f60f2aaa5176ca703fa01fbaf01059fe989c0029 (diff) |
QQuickTableView: set empty content size when table is empty
From before we would bail out early from the rebuild process if we
detected an empty table. A result from this is that we left
both contentWidth and contentHeight unchanged.
This patch will set an empty content size when the table is
empty. The effect will be that the user cannot flick the view
around based on the old size.
Fixes: QTBUG-80505
Change-Id: I3ac080476269fd5906ce79fa007eabb59b5ff4b1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquicktableview/tst_qquicktableview.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp index 405524b704..7c4a5ed65b 100644 --- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp +++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp @@ -2719,6 +2719,8 @@ void tst_QQuickTableView::replaceModel() QTRY_COMPARE(tableView->rows(), 2); tableView->setModel(QVariant()); QTRY_COMPARE(tableView->rows(), 0); + QCOMPARE(tableView->contentWidth(), 0); + QCOMPARE(tableView->contentHeight(), 0); } QTEST_MAIN(tst_QQuickTableView) |