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. Instantiator and new object's parent
Qt 6.11 is out! See what's new in the release blog

Instantiator and new object's parent

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 238 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.
  • N Offline
    N Offline
    nguyenbinh
    wrote on last edited by nguyenbinh
    #1

    Hello all!

    I have this code in my app:

    Window {
        // ...
        ListModel {
            id: listmodel
        }
    
        Shape {
            // ...
            Instantiator {
                model: listmodel
                delegate: ShapePath {
                    // ...
                }
            }
        }
        // ...
    }
    

    The above code doesn't render the path when I append new item to listmodel, it seems like the ShapePath created by Instantiator set it's parent to the Instantiator itself while the Shape expects ShapePath as direct children. Is there a way to control parent of objects created by Instantiator?

    1 Reply Last reply
    0

    • Login

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