-
Task
-
Resolution: Fixed
-
P2: Important
-
None
-
None
-
98c8fa2a5 (dev), 7312f0a94 (6.10), ad65c8d89 (dev), dbbd4d1a2 (6.10), 425f353cb (tqtc/lts-6.8)
A case study: the "Qt Quick Controls - Flat Style" example (https://doc.qt.io/qt-6/qtquickcontrols-flatstyle-example.html )
Although https://codereview.qt-project.org/c/qt/qtdeclarative/+/573813 effectively applies QTP0004, this example doesn't actually make use of QTP0004. Rather, it still provides manually-written qmldir files, which we want to discourage.
Suggestion: Update our examples to make use of our automatic qmldir generation functionality
For our case study
We need to remove the manually-written qmldir files from the CMakeLists.txt file, and then add the following line:
set_source_files_properties("imports/Theme/Theme.qml" PROPERTIES QT_QML_SINGLETON_TYPE TRUE )
This lets the project build and run with auto-generated qmldir files.
We could go a step further and add CMakeLists.txt files + qt_add_qml_module() to imports/Flat/ and imports/Theme/, so that we don't need to rely on QTP0004.
For our examples in general
A quick grep of C:\Qt\Examples\Qt-6.8.1 reveals almost 100 manually-written qmldir files. It would be nice to not need them (at least for CMake projects)