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

Assigning screens in ApplicationWindow possible only AFTER they have been created

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.1
    • 5.9.0 Beta 4
    • Quick: Controls 2
    • None
    • Windows 10 x64 Pro, MSVC2015, Qt 5.9 beta
    • 82310bc78b5c52bfe0a2eca5d3a67bdfc81d1dd9

    Description

      The Qt.application documentation says:

       

      In addition to examining properties like name, width, height, etc., the array elements can also be assigned to the screen property of Window items, thus serving as an alternative to the C++ side's QWindow::setScreen().

      ...which sort of works, but might not be the expected/desired behavior (ie assign works, but binding doesn't)

       

      For example, this fails:

      import QtQuick 2.5
      import QtQuick.Controls 2.1
      import QtQuick.Window 2.2
      import "utils.js" as scr
      
      ApplicationWindow {
          visibility: Window.FullScreen
          screen: Qt.application.screen[scr.getExtScreenId()]
      
      ...
      
      }
      

      ... with ""ApplicationWindow.screen" is not available due to component versioning.", but

       import QtQuick 2.5
      import QtQuick.Controls 2.1
      import QtQuick.Window 2.2
      import "utils.js" as scr
      
      ApplicationWindow {
          id: wnd
          visibility: Window.FullScreen
          Component.onCompleted: wnd.screen = Qt.application.screen[scr.getExtScreenId()]
      
      ...
      
      }
      

       

      I know managing the lifecycle of attached properties like Screen can be tricky, but if this is the intended behavior, the documentation needs to be more clear on the recommended ways of how to use it.

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              achipa Attila Csipa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes