From e1cc06972a42e2bae51b027737919445d0e675f7 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 5 Dec 2019 14:53:55 +0100 Subject: 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 --- tests/auto/quick/qquicktableview/tst_qquicktableview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') 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) -- cgit v1.2.3