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

QStackedWidget::removeWidget does not revert ownership

    XMLWordPrintable

Details

    • 2023b9e76baf8d8a3b1ea59748624e16f3297ac3

    Description

      QStackedWidget::removeWidget does not revert ovnership to application as stated in documentation:
      " Note: Ownership of widget reverts to the application."

      Code like this

      QStackedWidget *stack = new QStackedWidget;
      QFrame *frame = new QFrame(this);

      qDebug() << frame->parent() << frame->parentWidget();
      stack->addWidget(frame);
      qDebug() << frame->parent() << frame->parentWidget();
      stack->removeWidget(frame);
      qDebug() << frame->parent() << frame->parentWidget();

      produces output like this:

      MainWindow(0xcdfb70) MainWindow(0xcdfb70)
      QStackedWidget(0xfd6100) QStackedWidget(0xfd6100)
      QStackedWidget(0xfd6100) QStackedWidget(0xfd6100)

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              uaf Igor Yampolskiy
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes