Details
-
Suggestion
-
Resolution: Out of scope
-
P3: Somewhat important
-
None
-
None
Description
Sometimes you want to create a QML element, but need a specific piece of C++ functionality (like Attached properties for example). It should be possible to create a QQuickItem subclass which loads a template QML file on top of itself, and then it can be subclassed to create a hybrid Item. E.g. MyItem would load MyItem.qml which would effectively have a C++ MyItem for a root and yet when the module is imported and MyItem created the QML file is instantiated with the C++ MyItem as a root.
Currently this is quite simple if you just use different names for the C++ base and the QML file. But it should be possible to have it with the same name, so as to implicitly add C++ features to a type originally written with QML, or vice-versa.