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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.8.5, 5.0.0 RC 1
    • 4.8.4, 5.0.0 Beta 1
    • Widgets: Layout
    • None
    • 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

            mmutz Marc Mutz
            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