From 6ec7953257ef1155aef8a0a4b8379205ee850283 Mon Sep 17 00:00:00 2001 From: Andrei Golubev Date: Wed, 20 Oct 2021 11:14:52 +0200 Subject: 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 --- src/qml/doc/src/cmake/qt_target_compile_qml_to_cpp.qdoc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/qml/doc') diff --git a/src/qml/doc/src/cmake/qt_target_compile_qml_to_cpp.qdoc b/src/qml/doc/src/cmake/qt_target_compile_qml_to_cpp.qdoc index 99c64e74ab..f6c56a94af 100644 --- a/src/qml/doc/src/cmake/qt_target_compile_qml_to_cpp.qdoc +++ b/src/qml/doc/src/cmake/qt_target_compile_qml_to_cpp.qdoc @@ -40,6 +40,7 @@ qt_target_compile_qml_to_cpp( target FILES ... + [NAMESPACE namespace] ) \endcode @@ -67,6 +68,10 @@ most cases, all the target's QML files would be specified in the FILES. This way, FILES argument is equivalent to QML_FILES argument of the qt_add_qml_module() command. +\c NAMESPACE argument defines a namespace, in which the generated C++ code +resides. By default, no namespace is specified for user projects. The code +generated from Qt's own sources is put under a QT_NAMESPACE namespace. + While processing FILES, the following source file properties are respected: \list \li \c{QT_QMLTC_FILE_BASENAME}: use this source file property to specify a -- cgit v1.2.3