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

ApplicationWindow.contentItem shadows Window.contentItem

    XMLWordPrintable

Details

    Description

      ApplicationWindow inherits Window which instantiates QQuickWindow. It is surprising/unintuitive that ApplicationWindow.contentItem != QQuickWindow::contentItem() (e.g. QTBUG-122286 resulted from this surprise/misunderstanding)

      Furthermore, consider this code which demonstrates more surprises by the current API:

      import QtQuick
      import QtQuick.Controls.Basic
      
      ApplicationWindow { // Change "ApplicationWindow" -> "Window" for investigation
          id: window
          width: 640
          height: 480
          visible: true
      
          TextEdit {
              anchors.centerIn: parent
              text: "window.contentItem: " + window.contentItem + '\n' // Regular property
                  + "Window.contentItem: " + Window.contentItem        // Attached property
          }
      }
      

      Example Window output (makes sense):

      window.contentItem: QQuickRootItem(0x1bed8500d20)
      Window.contentItem: QQuickRootItem(0x1bed8500d20)
      

      Example ApplicationWindow output (surprising):

      window.contentItem: QQuickContentItem(0x155dafb9250, "Main")
      Window.contentItem: QQuickRootItem(0x155dafb9850)
      

      Attachments

        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
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes