Enum declarations in QML
Solved
QML and Qt Quick
-
So with the added support of enum declarations in QML since Qt 5.10 and QtCreator 4.8 I'm still unable to create an enum in qml:
enum MyState { StateOne, StateTwo, StateThree } property int test: MyState.StateOne
ReferenceError: MyState is not defined
What am I missing?
-
Did you use Q_ENUM to export to QML ?
e.g Q_ENUM(MyState) -
@dheerendra this is not c++ code. This is purely qml...
-
Fixed: http://doc.qt.io/qt-5/qtqml-syntax-objectattributes.html#enumeration-attributes
Filename.EnumName.EnumValue