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

QLayout does not cancel parent<->child relationship in takeAt and removeItem

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 4.8.4, 5.0.0 Beta 1
    • Fix Version/s: 4.8.5, 5.0.0 RC 1
    • Component/s: Widgets: Layout
    • Labels:
      None
    • Commits:
      716d33d2a73ade42eb31be3e8ecbaeecdd5ddd21

      Description

      This code crashes because the QLayout held by 'item' is deleted twice:

      QBoxLayout *myLayout = new QHBoxLayout;
      QBoxLayout *subLayout = new QHBoxLayout;
      myLayout->addLayout(subLayout);
      QLayoutItem *item = myLayout->takeAt(0);

      delete myLayout;
      delete item;

        Attachments

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

          Activity

            People

            Assignee:
            mmutz Marc Mutz
            Reporter:
            litb Johannes Schaub
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes