How to instantiate recursive component with QML Instantiator?
-
wrote on 12 May 2021, 17:10 last edited by
Hello!
I need to instantiate recursive tree of components in QML which are not derived from Item. The only way seems to be Instantiator. Unfortunately when I try code like this:
// MyCustomGroup.qml import QtQml.Models 2.15 MyGroup { id: entity property var model Instantiator { model: MyListItemModel { model: entity.model.children } MyCustomGroup { model: model.display } } }
I receive QML loading error:
MyCustomGroup is instantiated recursively
Unfortunately I cannot use Loader component to break this recursion as my types are derived from QObject.
Any ideas?
Thanks
1/1