-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
https://doc.qt.io/qt-6/qtqml-cppintegration-overview.html needs a revamp:
- The overview focusses exclusively on defining object types as a new, custom C++ class. It should also discuss:
- Value types (see QTBUG-122015)
- QML namespaces (see https://doc.qt.io/qt-6/qtqml-typesystem-namespaces.html) which are a lightweight way to expose C++ enums
- (slightly less important) The possibility of extending existing classes/namespaces (see the QML_EXTENDED* and QML_FOREIGN* macros at https://doc.qt.io/qt-6/qqmlintegration-h.html
- Context properties are now discouraged (see the big warnings at the top of https://doc.qt.io/qt-6/qtqml-cppintegration-contextproperties.html) so they should be de-emphasized. They're still worth mentioning in the overview since the mechanism exists, but they must be accompanied by clear warnings which are currently missing.
- The "Exposing Attributes of C++ Classes to QML" section should not come first, since it is not a standalone topic. Rather, exposing attributes is part of exposing C++ classes to QML.
- depends on
-
QTBUG-122015 Expand "QML and C++ Integration" overview to cover QML value types too
-
- Reported
-