[SOLVED]expose enum method to qml
QML and Qt Quick
4
Posts
2
Posters
8.1k
Views
1
Watching
-
Hi,
AFAIK, your enum should be part of a class registered in QML and you should use Q_ENUMS. See this example: http://lists.qt-project.org/pipermail/interest/2011-December/000255.html
-
Thanks for your help.
I accroding to the code it is works just has some little problem.
When I give a value to the enum method then I got 'Cannot assign [undefined] to int'.in class.h file:
@ Q_PROPERTY (LanguageType currentLanguage READ getLanguage WRITE setLanguage NOTIFY languageChanged)
Q_ENUMS(LanguageType)@in qml file:
@Settings.currentLanguage = Settings.LanguageEn;@