aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmltc/CMakeLists.txt
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2021-10-20 11:14:52 +0200
committerAndrei Golubev <andrei.golubev@qt.io>2021-11-16 09:02:57 +0100
commit6ec7953257ef1155aef8a0a4b8379205ee850283 (patch)
tree1dac0463d8500bb3a90c37095a09890607423ec7 /tests/auto/qml/qmltc/CMakeLists.txt
parent88dfbe0deaa780f1cb5793d644341367d02e3073 (diff)
qmltc: support user-specified namespaces in the generated code
Already during the prototyping phase, conflicts in class names were encountered within Qt code base. Those could be avoided by namespaces. Initial qmltc logic was using meaningless "q_qmltc" namespace, so let's improve that by allowing user-specified namespaces + making Qt's own QML files (compiled to C++) being available under QT_NAMESPACE. The latter is achieved by providing (and using) the internal version of a qmltc-invoking function Task-number: QTBUG-84368 Task-number: QTBUG-96040 Change-Id: I99cdf1baba8838c093b6b469f6744869f72af093 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qmltc/CMakeLists.txt')
-rw-r--r--tests/auto/qml/qmltc/CMakeLists.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/qml/qmltc/CMakeLists.txt b/tests/auto/qml/qmltc/CMakeLists.txt
index 5e6026046c..66d1e4bf01 100644
--- a/tests/auto/qml/qmltc/CMakeLists.txt
+++ b/tests/auto/qml/qmltc/CMakeLists.txt
@@ -32,7 +32,8 @@ qt6_add_qml_module(tst_qmltc_diskcache
target_compile_definitions(tst_qmltc_diskcache PRIVATE
QMLTC_TESTS_DISABLE_CACHE=0
)
-qt6_target_compile_qml_to_cpp(tst_qmltc_diskcache
+qt_internal_target_compile_qml_to_cpp(tst_qmltc_diskcache
+ NAMESPACE QmltcTest
FILES
${qml_sources}
)
@@ -55,7 +56,8 @@ qt6_add_qml_module(tst_qmltc_nodiskcache
target_compile_definitions(tst_qmltc_nodiskcache PRIVATE
QMLTC_TESTS_DISABLE_CACHE=1
)
-qt6_target_compile_qml_to_cpp(tst_qmltc_nodiskcache
+qt_internal_target_compile_qml_to_cpp(tst_qmltc_nodiskcache
+ # NAMESPACE QmltcTest # use QT_NAMESPACE instead
FILES
${qml_sources}
)