Currently QML only supports enums as signal and method parameters if they are declared in the same class as the signal or method. This is a limitation inherited from QMetaObject, that doesn't allow QML to determine if the parameter type is an enum, or just some other random type.
The ideal solution would be to extend Q_ENUMS() to support "registering" an enum from another class. For example:
in this case, all QML really needs is for the Bar::staticMetaObject to appear in the Foo::staticMetaObject's extra data list.
|For Gerrit Dashboard: QTBUG-20639|
|9746,1||Add support to moc for registering non-local enums via Q_ENUMS.||master||qt/qtbase||Status: MERGED||+2||0|
|9748,13||Support (registered) non-local enums for signal/slot params in QML.||master||qt/qtdeclarative||Status: MERGED||+2||0|