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

Setting transient parent for child window does not work when using QQuickWidget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.6.2, 6.7
    • None
    • Fedora 39, KDE Plasma
    • Linux/Wayland

    Description

      The following code creates two windows where one is the transientParent of the other

      import QtQuick
      
      Window {
          Rectangle {
              id: root
      
              color: "red"
              width: 500
              height: 500
      
              property Window w: Window.window
      
              Window {
                  visible:  true
                  transientParent: root.w
              }
          }
      }
       

      It works as expected.

      When replacing the root window with a QMainWindow+QQuickWidget it stops working. See https://invent.kde.org/nicolasfella/qquickwidgetparenttest for the code.

      Running it I get

      > qrc:/main.qml:11:5: Unable to assign QQuickWidgetOffscreenWindow to QQuickWindowQmlImpl

      Replacing "property Window" with "property var" makes the warning go away, but the windows still have no transient parent relationship.

      Tested with Qt 6.7 (qtbase 9539f527fcda6ca9b8df09e63fd93f0206649a41, qtdeclarative baa0f7b55fc85e1db0debbce5820aa42ac10c088) and 6.6.2

      Attachments

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

        Activity

          People

            vestbo Tor Arne Vestbø
            nicolasfella Nicolas Fella
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes