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

[Windows]: "External WM_DESTROY received for..." message sent when deleting a window after reparenting one of its child windows

    XMLWordPrintable

Details

    Description

      When calling deleteLater() on a top level QWidget after it has just reparented a child top level widget to its own parent then it will trigger the message:

      "5.7.0 windows"
      MainWindow(0x2dfd3bfaa0) on QWidget(0x0)
      MainWindow(0x22db8c38d70) on MainWindow(0x2dfd3bfaa0, name="MainWindow0")
      MainWindow::on_createChildButton_clicked MainWindow(0x22db8c38d70, name="MainWindow1")
      MainWindow(0x22dbbc98cd0) on MainWindow(0x22db8c38d70, name="MainWindow1")
      MainWindow::on_createChildButton_clicked MainWindow(0x22dbbc98cd0, name="MainWindow2")
      MainWindow::on_deleteSelfButton_clicked >reparenting MainWindow(0x22dbbc98cd0, name="MainWindow2") to MainWindow(0x2dfd3bfaa0, name = "MainWindow0")
      MainWindow::on_deleteSelfButton_clicked >deleteLater
      MainWindow::on_deleteSelfButton_clicked <
      MainWindow::~MainWindow "MainWindow1"
      External WM_DESTROY received for QWidgetWindow(0x22dbbc92720, name="MainWindow2Window") , parent: QWindow(0x0) , transient parent: QWidgetWindow(0x22db8c129a0, name="MainWindow0Window")
      ...
      MainWindow::~MainWindow "MainWindow0"
      MainWindow::~MainWindow "MainWindow2"

      This does not happen if the child is not reparented before hand. So if you have a chain of widgets all top level like:

      A which is a parent of B which is a parent of C

      then reparent C to be a child of A and call deleteLater() on B it will trigger the message.

      Attachments

        1. qtbug52734.zip
          4 kB
          Andy Shaw
        2. qtbug52734.zip
          2 kB
          Friedemann Kleint
        3. qgbug52734_stack.txt
          11 kB
          Friedemann Kleint
        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
            andysh Andy Shaw
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes