Details
-
Suggestion
-
Resolution: Won't Do
-
P4: Low
-
4.7.0
Description
Right now, the only possibility to use C++ enums in QML is to wrap them in a QObject and then export the entire QObject to QML.
It would be much more convenient if exporting an enum directly would be possible.
The desired workflow for that would be something like this:
code
enum Weather
;
Q_DECLARE_METATYPE(Weather)
qmlRegisterType<Weather>("Foo", 1, 0, "Weather");
code
Ideally, the enum should not only be supported as a function parameter or return value when invoking C++ code, but also as properties in QML, as QTBUG-15483 describes.
Attachments
Issue Links
- relates to
-
QTBUG-48497 QML enums should be 'strong'
-
- Reported
-