aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitemview.cpp
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals@canonical.com>2016-03-07 13:18:56 +0100
committerAlbert Astals Cid <albert.astals@canonical.com>2016-03-11 13:30:34 +0000
commit201dec50b6f08b740aab9947725f8f5ec36349bb (patch)
tree4b56b6dac0f81afc9f1b6c613c3ba80b05e36bd9 /src/quick/items/qquickitemview.cpp
parent644a6a42a45ceb9790df6d6ee1c3ba43c7b9ab10 (diff)
QQuickItemView::forceLayout: Also call layout when d->forceLayout
This way callers of forceLayout get a relayout if the dimension of a delegate that affects the itemview content size has just changed but the itemview content size has not been updated yet. This is useful because sometimes in the QML side you want to do things when the item view delegate size has changed but need the item view content size to be already updated. Change-Id: I846984a841e8e14c84d7a700a7ff736196b60afb Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquickitemview.cpp')
-rw-r--r--src/quick/items/qquickitemview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp
index 188b347a20..aff03b7539 100644
--- a/src/quick/items/qquickitemview.cpp
+++ b/src/quick/items/qquickitemview.cpp
@@ -1052,7 +1052,8 @@ QQuickItem *QQuickItemView::itemAt(qreal x, qreal y) const
void QQuickItemView::forceLayout()
{
Q_D(QQuickItemView);
- d->applyPendingChanges();
+ if (isComponentComplete() && (d->currentChanges.hasPendingChanges() || d->forceLayout))
+ d->layout();
}
void QQuickItemViewPrivate::applyPendingChanges()