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 09:47:15 +0000
commit827d7680f84b24427f6fc501ba21cb8445679bc3 (patch)
tree3676bf1c9adc5c910cfd09325406de8b21577c0c
parentbaf7f594a254a56ae94bb01c808c8c72df735745 (diff)
downloadqtquickcontrols-827d7680f84b24427f6fc501ba21cb8445679bc3.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> (cherry picked from commit da94d6586cbe6b9c12dec8ecc0f842aad807b0d3)
-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 37ecabbf..d99cb0b0 100644
--- a/src/controls/Private/BasicTableView.qml
+++ b/src/controls/Private/BasicTableView.qml
@@ -493,7 +493,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 {