From f18fb076b6196b195d953f050e6e150954372be6 Mon Sep 17 00:00:00 2001 From: Matthew Vogt Date: Mon, 9 Jul 2012 14:54:18 +1000 Subject: [PATCH] Fix qmlscene initial resize for delayed loading When QQuickView acquires a default initial size while waiting for the source component to be loaded, the resulting width() and height() are 1 rather than zero. Fix the check for default size after component has loaded to account for this disparity. Change-Id: Ifaf418525e66dcc094c87ac1f9b63d1b05a08fd7 Reviewed-by: Martin Jones --- src/quick/items/qquickview.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp index 0322caf..52c9959 100644 --- a/src/quick/items/qquickview.cpp +++ b/src/quick/items/qquickview.cpp @@ -483,8 +483,8 @@ void QQuickViewPrivate::setRootObject(QObject *obj) } if (root) { initialSize = rootObjectSize(); - if ((resizeMode == QQuickView::SizeViewToRootObject || !q->width() || !q->height()) - && initialSize != q->size()) { + if ((resizeMode == QQuickView::SizeViewToRootObject || q->width() <= 1 || q->height() <= 1) && + initialSize != q->size()) { q->resize(initialSize); } initResize(); -- 1.7.2.5