Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to instantiate recursive component with QML Instantiator?
Forum Updated to NodeBB v4.3 + New Features

How to instantiate recursive component with QML Instantiator?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 500 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Igor Baidiuk
    wrote on 12 May 2021, 17:10 last edited by
    #1

    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 Reply Last reply
    0

    1/1

    12 May 2021, 17:10

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved