aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickloader.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-10-24 12:32:39 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2017-10-24 12:32:39 +0000
commit1aa91f8b0b140c417c6e97dfd22fa498d31bceb6 (patch)
tree714b9c79ca84cf9bda9912ea723cd925f0e8f4c9 /src/quick/items/qquickloader.cpp
parent83c8f8d90a960965c1f166c4421f514f4236212a (diff)
parent15dd1b7883f5dbe66266aeb588381f85f3532ab9 (diff)
Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10
Diffstat (limited to 'src/quick/items/qquickloader.cpp')
-rw-r--r--src/quick/items/qquickloader.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp
index cd356a9eeb..27afe5a5db 100644
--- a/src/quick/items/qquickloader.cpp
+++ b/src/quick/items/qquickloader.cpp
@@ -916,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)