-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.4
-
None
Documentation on how to register QML types the new and better way with QML_ELEMENT is not documented very well right now.
All the bits and pieces seem to be available in the documentation, but they are a little scattered, and hard to search for. For instance, searching for the right cmake functions to call to achieve the same result as setting QML_IMPORT_NAME and QML_IMPORT_MAJOR_VERSION in a qmake project took me considerable time, and that's with me knowing that there is a way to achieve this with cmake - I just didn't know what the name of the function(s) were.
Current documentation on the subject seems to be in these places:
- https://doc.qt.io/qt-6/qtqml-modules-cppplugins.html
- https://doc.qt.io/qt-6/qtqml-cppintegration-topic.html
- https://doc.qt.io/qt-6/qqmlengine.html#QML_ELEMENT
The latter QQmlEngine page specifies the most about this, but it's certainly not in a place people will easily find searching. I think there needs to be a more front-and-center doc page showing the Qt 5.15/Qt 6 new way to register QML types (so they aren't registered procedurally).
(2) doesn't indicate how to register QML types with cmake at all. This is probably the right place to document this all.
- relates to
-
QTBUG-102330 "Creating C++ Plugins for QML" docs need to be updated with cmake use
-
- Closed
-