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

Transient parent of Window is not clear when Loader is involved

    XMLWordPrintable

Details

    • 4b014effe1f27407f5073ba738498ce87b918b9d 02c98b7590b060430dc5ce7e5821fa13087d25f7

    Description

      The following example demonstrates the issue. Case 2 exhibits unexpected behavior (I'd expect it to behave identical to Cases 1 and 3):

      import QtQuick 2.0
      import QtQuick.Window 2.2
      
      Item {
          width: 400
          height: 400
      
          // case 1: top level window is transient parent of window 1
      //    Window {
      //        width: 200
      //        height: 200
      //        visible: true
      //        color: "blue"
      
      //        Text {
      //            anchors.centerIn: parent
      //            color: "white"
      //            text: "Window 1"
      //        }
      //    }
      
          // case 2: top level window is *not* transient parent of window 2
          Loader {
              sourceComponent: Window {
                  width: 100
                  height: 100
                  visible: true
                  color: "red"
      
                  Text {
                      anchors.centerIn: parent
                      color: "white"
                      text: "Window 2"
                  }
              }
          }
      
          // case 3: top level window is transient parent of window 3
      //    Loader {
      //        sourceComponent: Item {
      //            Window {
      //                width: 100
      //                height: 100
      //                visible: true
      //                color: "orange"
      
      //                Text {
      //                    anchors.centerIn: parent
      //                    color: "white"
      //                    text: "Window 3"
      //                }
      //            }
      //        }
      //    }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              mbrasser Michael Brasser
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: