aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickloader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickloader.cpp')
-rw-r--r--src/quick/items/qquickloader.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp
index 9f27beb298..27afe5a5db 100644
--- a/src/quick/items/qquickloader.cpp
+++ b/src/quick/items/qquickloader.cpp
@@ -852,6 +852,7 @@ qreal QQuickLoader::progress() const
\qmlproperty bool QtQuick::Loader::asynchronous
This property holds whether the component will be instantiated asynchronously.
+By default it is \c false.
When used in conjunction with the \l source property, loading and compilation
will also be performed in a background thread.
@@ -915,9 +916,14 @@ void QQuickLoaderPrivate::_q_updateSize(bool loaderGeometryChanged)
if (!item)
return;
- if (loaderGeometryChanged && q->widthValid())
+ const bool needToUpdateWidth = loaderGeometryChanged && q->widthValid();
+ const bool needToUpdateHeight = loaderGeometryChanged && q->heightValid();
+
+ if (needToUpdateWidth && needToUpdateHeight)
+ item->setSize(QSizeF(q->width(), q->height()));
+ else if (needToUpdateWidth)
item->setWidth(q->width());
- if (loaderGeometryChanged && q->heightValid())
+ else if (needToUpdateHeight)
item->setHeight(q->height());
if (updatingSize)