From da94d6586cbe6b9c12dec8ecc0f842aad807b0d3 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 25 Sep 2019 10:21:42 +0200 Subject: Only calculate the height of the ListView when there are model entries When it tries to calculate the height of the listview then it depends on the model having entries. If there is no model or no entries in it then it will cause a warning to be outputted indicating that the model size is less than 0. This prevents it from occurring as a result. Fixes: QTBUG-72543 Change-Id: I7155a3a240fdcdf93caddfce332f0cc6bb0f0ec0 Reviewed-by: Mitch Curtis --- src/controls/Private/BasicTableView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/controls/Private/BasicTableView.qml b/src/controls/Private/BasicTableView.qml index bc044eeb2..6c7c5511f 100644 --- a/src/controls/Private/BasicTableView.qml +++ b/src/controls/Private/BasicTableView.qml @@ -492,7 +492,7 @@ ScrollView { y: listView.contentHeight - listView.contentY + listView.originY width: parent.width visible: alternatingRowColors - height: viewport.height - listView.contentHeight + height: listView.model && listView.model.count ? (viewport.height - listView.contentHeight) : 0 Repeater { model: visible ? parent.paddedRowCount : 0 Loader { -- cgit v1.2.3