diff options
author | Sami Shalayel <sami.shalayel@qt.io> | 2022-12-21 16:31:20 +0100 |
---|---|---|
committer | Sami Shalayel <sami.shalayel@qt.io> | 2023-01-06 18:28:31 +0100 |
commit | 3df8eba0f5e9f9b0142914d53c1183c5a05030e7 (patch) | |
tree | c7b9be965fa265823904155c66afb372285db6e3 /src/qml/doc/snippets | |
parent | 4e1fe071ff05b92ed12fdf59a2185e1254b411cf (diff) |
qmltc: generate code into namespaces
Generate code into namespaces to avoid clashes between qmltc-generated
and user code. Code generated by qmltc will by default be put in the
URI_OF_MODULE namespace, and will generate subnamespaces
to follow the module hierarchy if URI_OF_MODULE contains dots('.').
Also fix the test to use the new namespaces.
[ChangeLog][Qml][qmltc] The type compiler will generate C++-code into
a namespace by default. The new default namespace is inferred from
the module's URI, where dots are interpreted as separating subnamespaces
from each other,
e.g., a type in module MyCompany.MyModule.Sub will be generated in the namespace
MyCompany::MyModule::Sub.
Fixes: QTBUG-109274
Change-Id: I3bfe2697b81e90bb63a079dc44c2810fc9925f97
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qml/doc/snippets')
-rw-r--r-- | src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp b/src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp index a78da416e2..7bda70f985 100644 --- a/src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp +++ b/src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp @@ -53,7 +53,7 @@ void tst_qmltc_examples::app() QQmlEngine e; QQuickWindow window; - QScopedPointer<myApp> documentRoot(new myApp(&e)); + QScopedPointer<QmltcExample::myApp> documentRoot(new QmltcExample::myApp(&e)); documentRoot->setParentItem(window.contentItem()); window.setHeight(documentRoot->height()); |