aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-09-21 13:56:05 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-09-21 13:33:58 +0000
commit4bc93d15705052992c639b3954d0d4048792038c (patch)
tree1c9ad9c8700f342c278742a2ad05b508e0f8d406
parent65abbf2370fa282f68286b17ee95f0c23e8330b0 (diff)
QQuickApplicationWindow: reduce the amount of re-layouting
80f6b14 introduced a binding loop in testbench: qrc:/testbench.qml:263:13: QML TabBar: Binding loop detected for property "implicitWidth" This issue is best to fix in QQuickApplicationWindow, which is causing the loop by being way too eager to force-resize the TabBar in the middle of calculating its initial implicit size. Let it complete construction first. Change-Id: Ie3d8679efc73002af6c37f17c138b2f1e9668897 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/quicktemplates2/qquickapplicationwindow.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickapplicationwindow.cpp b/src/quicktemplates2/qquickapplicationwindow.cpp
index 872783bf..2ef84a17 100644
--- a/src/quicktemplates2/qquickapplicationwindow.cpp
+++ b/src/quicktemplates2/qquickapplicationwindow.cpp
@@ -194,6 +194,9 @@ static void layoutItem(QQuickItem *item, qreal y, qreal width)
void QQuickApplicationWindowPrivate::relayout()
{
Q_Q(QQuickApplicationWindow);
+ if (!complete)
+ return;
+
QQuickItem *content = q->contentItem();
qreal hh = header && header->isVisible() ? header->height() : 0;
qreal fh = footer && footer->isVisible() ? footer->height() : 0;
@@ -810,6 +813,7 @@ void QQuickApplicationWindow::componentComplete()
Q_D(QQuickApplicationWindow);
d->complete = true;
QQuickWindowQmlImpl::componentComplete();
+ d->relayout();
}
void QQuickApplicationWindow::resizeEvent(QResizeEvent *event)