Usage of abstract base class registered in QML
-
I've have a Q_OBJECT derived C++ base class, which is registered with QML using qmlRegisterType. This registered type is a property of a QML item, which defaults to null, like so:
Item { id: root property QtBaseClass implementation: nullIn turn, there are many QML Items that contain this QML item. Each of them sets the property
implementationto an instance of a class derived from QtBaseClass.QtBaseClass itself has no useful function definitions, so I'd like to make it abstract. However, if I make it abstract and register it with qmlRegisterInterface or qmlRegisterUncreatableType, I can't use it as a QML property in this way, even if it is set to null.
What is the intended method to accomplish what I'm doing?