From 201dec50b6f08b740aab9947725f8f5ec36349bb Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 7 Mar 2016 13:18:56 +0100 Subject: 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 Reviewed-by: Shawn Rutledge --- src/quick/items/qquickitemview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/quick/items/qquickitemview.cpp') 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() -- cgit v1.2.3