aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/snippets
diff options
context:
space:
mode:
authorAlexei Cazacov <alexei.cazacov@qt.io>2024-09-16 09:47:38 +0300
committerAlexei Cazacov <alexei.cazacov@qt.io>2024-09-25 08:54:56 +0300
commit1c7e8aa0f004b90293f41ec44df76aea594d2200 (patch)
treef136e318f7d69f2906b263bf0dfa32051acea034 /src/qml/doc/snippets
parent88e588b6bfe5a3daad619705521b4c9329114288 (diff)
Docs: Snippet update for QMLTC documentation
This commit adds a comment with the info on when the snippet is applicable. Task-number: QTBUG-127443 Pick-to: 6.8 6.7 Change-Id: Ia89df2334c32e58795f976072ec18775a8c0d2e8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/doc/snippets')
-rw-r--r--src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp b/src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp
index 8c2706531b..12586013c4 100644
--- a/src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp
+++ b/src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp
@@ -51,6 +51,8 @@ void tst_qmltc_examples::app()
app.setApplicationDisplayName(QStringLiteral("This example is powered by qmltc!"));
QQmlEngine e;
+ // If the root element is Window, you don't need to create a Window.
+ // The snippet is for the cases where the root element is not a Window.
QQuickWindow window;
QScopedPointer<QmltcExample::myApp> documentRoot(
@@ -81,6 +83,8 @@ void tst_qmltc_examples::appComponent()
app.setApplicationDisplayName(QStringLiteral("This example is powered by QQmlComponent :("));
QQmlEngine e;
+ // If the root element is Window, you don't need to create a Window.
+ // The snippet is for the cases where the root element is not a Window.
QQuickWindow window;
QQmlComponent component(&e);