Details
-
Task
-
Resolution: Fixed
-
P2: Important
-
6.5
-
None
-
-
377501f35 (dev), c05eb170d (6.6), 4cc830764 (6.5)
Description
People keep asking how to use C++ enums on the Qt Quick side. In Qt5, a few approaches were known, for example https://qml.guide/enums-in-qt-qml/ . This should not be used in Qt6. For Qt6, there is the Q_ENUM macro which should be used in combination with QML_ELEMENT. There is no example or other places in the docs explaining how this actually works, Maybe an entry in the new https://doc-snapshots.qt.io/qt6-dev/qtquick-how-tos.html would be a place for this
Attachments
Issue Links
- is duplicated by
-
QTBUG-114394 Improve documentation on how to register C++ types with enums for QML as value types and namespaces
-
- Closed
-