Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64546

Instantiator: provide a way to set the QObject parent of the objects it creates

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • None
    • None

      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.

        For Gerrit Dashboard: QTBUG-64546
        # Subject Branch Project Status CR V

            srutledg Shawn Rutledge
            srutledg Shawn Rutledge
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change