Unsolved Searching for something like QQmlListProperty<QQmlComponent>
-
Currently I use a
QQmlListProperty<QObject>
asDefaultProperty
in my C++ classFoo
and my QML looks like this:Foo { Bar {} Bar {} Bar {} }
So nothing really exciting. However, I only need a few of these elements instantiated at the same time (and I already know which ones on the C++ side). My first idea was to use a
QmlListProperty<QQQmlComponent>
. That would be easy, but unfortunately it does not work.I can't change the QML code. But I want to control the instantiation of the elements on the C++ side. As if
Bar
would be implicitly assigned to aQQmlComponent
in the above QML code. Hence the idea with theQQmlListProperty<QQmlComponent>
, which unfortunately does not work.Does anyone have any ideas on how I could achieve this? Is there any (private) API that could help?
Thank you in advance
Stefan -
Have you found a solution for your issue yet? I'm facing the same question.
Cheers!
-
@DuBu
i think there is no workaround yet other than wrapping all child items:Foo { Component { Bar {} } Component { Bar {} } Component { Bar {} } }
But maybe this is indeed worth a feature request via the bugtracker.