diff options
author | Liang Qi <liang.qi@qt.io> | 2017-10-23 12:09:30 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-10-24 11:13:09 +0200 |
commit | 15dd1b7883f5dbe66266aeb588381f85f3532ab9 (patch) | |
tree | 1fa8caa8ec0f38aef39bcf920e3d5c7efeae5cb9 /src/quick/items/qquickloader.cpp | |
parent | f82c4de515223574bcc510de0d993426b22bccbe (diff) | |
parent | ebceda0cad6d86f6d6fe5efbf85a3b06fb4222b0 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
src/qml/qml/qqmlimport.cpp
src/qml/qml/qqmlimport_p.h
src/qml/qml/qqmltypenamecache.cpp
Done-with: Ulf Hermann<ulf.hermann@qt.io>
Change-Id: I41ba7a592b2659ddf53da6952ea3b456a7bba319
Diffstat (limited to 'src/quick/items/qquickloader.cpp')
-rw-r--r-- | src/quick/items/qquickloader.cpp | 9 |
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) |