summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-09-25 10:21:42 +0200
committerAndy Shaw <andy.shaw@qt.io>2019-09-25 10:50:15 +0200
commitda94d6586cbe6b9c12dec8ecc0f842aad807b0d3 (patch)
treef80b38a8fc1f6c20c8687b398c0b105b60e38d8a
parentac9f2e582dc6c0f740b8c5b225bc65a8c1b35e9e (diff)
downloadqtquickcontrols-da94d6586cbe6b9c12dec8ecc0f842aad807b0d3.tar.gz
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 <mitch.curtis@qt.io>
-rw-r--r--src/controls/Private/BasicTableView.qml2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/controls/Private/BasicTableView.qml b/src/controls/Private/BasicTableView.qml
index bc044eeb..6c7c5511 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 {