From fc94e5c5cfab13aeae8609c55dcf2c883533ef3d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 15 Jun 2020 14:11:05 +0200 Subject: [PATCH] Explain that qmlscene automatically creates windows for bare Items Fixes: QTBUG-81963 Change-Id: I6cb597cdebdbdae04bb0b16d193898b83ed236a9 Reviewed-by: Fabian Kosmale Reviewed-by: Shawn Rutledge (cherry picked from commit efb4d6bfd876b71fc4c942444319cb0b24bda41e) Reviewed-by: Qt Cherry-pick Bot --- doc/src/qmlapp/qmlscene.qdoc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/src/qmlapp/qmlscene.qdoc b/doc/src/qmlapp/qmlscene.qdoc index ca729cd80..02220774e 100644 --- a/doc/src/qmlapp/qmlscene.qdoc +++ b/doc/src/qmlapp/qmlscene.qdoc @@ -52,7 +52,14 @@ applications, and not as a launcher in a production environment. To launch a QML application in a production environment, develop a custom C++ application or bundle the QML file in a module. See \l {Deploying QML - applications} for more information. + applications} for more information. When given a bare \l Item as root + element, \c qmlscene will automatically create a window to show the scene. + Notably, \l QQmlComponent::create() will not do such a thing. Therefore, + when moving from a prototype developed with \c qmlscene to a C++ + application, you need to either make sure the root element is a + \l Window or manually create a window using QtQuick's C++ API. On the flip + side, the ability to automatically create a window gives you the option to + load parts of your prototype separately with \c qmlscene. To load a .qml file, run the tool and select the file to be opened, or provide the file path on the command prompt: