onto / protobuf-qt

Generate Qt/QML flavored sources from Protocol Buffers .proto files
MIT License
30 stars 10 forks source link

Enum QML Registration #2

Open xaqq opened 5 years ago

xaqq commented 5 years ago

Hello and thank you for this project,

I am using this project against Qt 5.12. When calling qmlRegisterType<MyEnumWrapper>("my.namesapce", 1, 0, "MyEnum"); QQmlPrivate::QQmlElement<T> (with T=MyEnumWrapper) complains that its destructor does not override. This is because MyEnumWrapper is not a QObject.

My current solution is to make MyEnumWrapper inherits from QObject, however I'm wondering if there is another way to register the enum to Qml that would avoid the issue altogether.