Explain that qmlscene automatically creates windows for bare Items

Fixes: QTBUG-81963
Change-Id: I6cb597cdebdbdae04bb0b16d193898b83ed236a9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit efb4d6bfd8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ulf Hermann 2020-06-15 14:11:05 +02:00 committed by Qt Cherry-pick Bot
parent d089c60dfd
commit fc94e5c5cf
1 changed files with 8 additions and 1 deletions

View File

@ -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: