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

QDeclarativePositioners and QGraphicsItem::setParentItem() QGraphicsItemPrivate::setParentItemHelper()

    XMLWordPrintable

Details

    Description

      To properly tool QDeclarativePositioners in Bauhaus (Qt Quick Visual Editor) and to avoid crashes: QGraphicsObject::setParentItem() has to be called instead of QGraphicsItemPrivate::setParentItemHelper() in
      QDeclarativeObject::children_append (and also clear).

      QDeclarativePositioners relies on the notifications send only by setParentItem() . If only setParentItemHelper() is called QDeclarativePositioners get into an invalid state and eventually access dangling pointers, if used dynamically as in Bauhaus. We also need similar changes in QDeclarative for QDeclarativeItems data property, but here we can rely on the componentComplete flag and we need no behavior change relevant to non Bauhaus code.

      proposed solution: We introduce an internal flag (false by default) that defines if children uses QGraphicsObject::setParentItem() (if true) or QGraphicsItemPrivate::setParentItemHelper() (default).
      Everybody that does rely on the notifications by QGraphicsObject::setParentItem() can turn on this flag (e. g. Bauhaus).

      For QDeclarativeItem we will just use componentComplete to decide if we have to use setParentItem() or setParentItemHelper(). If the component is not complete we use setParentItemHelper(). This is current behavior.
      If the component is complete we use setParentItem().

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
            thohartm Thomas Hartmann
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes