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

QML Window declared inside an Item is not visible

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.9.5, 5.10.1, 5.11.0 Beta 4, 5.11.0 RC 1, 5.11.1
    • Fix Version/s: 5.13.0 Alpha 1
    • Labels:
    • Environment:
      Mac 10.13.4

      Ubuntu 16.04 , 17.10
    • Commits:
      02c98b7590b060430dc5ce7e5821fa13087d25f7

      Description

      According to the document of Window type in QML:

      "A Window can be declared inside an Item or inside another Window;"

      However, the following code does not work with Qt 5.9.5 , Qt 5.10.1 and Qt 5.11 Beta 4 on Linux/Mac. The Window will not be visible. 

      import QtQuick 2.9
      import QtQuick.Window 2.2
      
      Item {
        Window {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
        }
      }
      
      

       

      However, the code above works with Qt 5.9.4 , Qt 5.10.0 . The window is visible. 

      This bug will affect multi-window applications,  make it difficult manage multi-window object instance.

      An example project is attached to reproduce the bug.

      Thanks

       

        Attachments

        1. main.qml
          16 kB
          Norbert Boucher
        2. qtbug-window-inside-item.zip
          6 kB
          Ben Lau
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            srutledg Shawn Rutledge
            Reporter:
            benlau Ben Lau
            Votes:
            16 Vote for this issue
            Watchers:
            20 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes