aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2019-06-21 15:12:36 +0200
committerEirik Aavitsland <eirik.aavitsland@qt.io>2019-06-28 09:46:11 +0200
commit692b2da77427259a3589cf8a1311075863f2f5ec (patch)
tree2718a180d3254122f6cb4cac00745c612ea76084 /src/quick/items
parentb8a85408d943bffba403d783b9082bd279460bed (diff)
Fix: ListView footer positioned wrong after last item removed
The refill() method would bail out early on an empty model. Make sure that it at least updates the header and footer in such situations. Fixes: QTBUG-31677 Change-Id: I1f3a1848ff263a8f7f9ccfc3b20f16b61348f57b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/qquickitemview.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp
index eead84d51e..d0715cdb7f 100644
--- a/src/quick/items/qquickitemview.cpp
+++ b/src/quick/items/qquickitemview.cpp
@@ -1717,8 +1717,14 @@ void QQuickItemViewPrivate::refill()
void QQuickItemViewPrivate::refill(qreal from, qreal to)
{
Q_Q(QQuickItemView);
- if (!isValid() || !q->isComponentComplete())
+ if (!model || !model->isValid() || !q->isComponentComplete())
return;
+ if (!model->count()) {
+ updateHeader();
+ updateFooter();
+ updateViewport();
+ return;
+ }
do {
bufferPause.stop();