Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
Description
So far, Instantiator sets the parent of anything it creates to itself. That's an acceptable default for memory management purposes, but it's not flexible enough. I think there should be a defaultParent property. The main use case I came up with so far is to be able to instantiate multiple PointHandlers (new in 5.10) to show feedback about multiple touchpoints: the parent of the handler should always be the Item within which it will receive events. And we did not make parent a settable property either, so far; so if it is instantiated with the wrong parent, it stays that way. It's anyway more efficient to construct it with the correct parent than to set it later, because reparenting would involve removing it from the QQuickItemPrivate::extraData::pointHandlers vector if its previous parent was an Item, and adding it to its new parent's vector. And that's why parent is so far not a settable property.
Attachments
Issue Links
- is duplicated by
-
QTBUG-95316 Instantiator doesn't work inside Column
- Closed
- relates to
-
QTBUG-84730 Allow to reassign PointerHandler.parent
- Closed
-
QTBUG-17286 There is no parent property in QtObject-based QML elements
- Open
-
QTBUG-83061 QML Repeater should allow creation of objects
- Closed
-
QTBUG-60121 Row and Column Repeater children have wrong QObject parent
- Closed
-
QTBUG-15085 Provide a way to change QObject parent
- Open
Gerrit Reviews
For Gerrit Dashboard: QTBUG-64546 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
187726,21 | WIP Instantiator: add defaultParent property | dev | qt/qtdeclarative | Status: NEW | -2 | 0 |
385454,2 | Instantiator: don't interfere with delegates that assign parents | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |