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

Resizing the Window overrides bindings on Overlay.overlay

    XMLWordPrintable

Details

    Description

      Code
      (Adapted from https://github.com/qt/qtdeclarative/tree/v6.7.0-beta3/tests/manual/window/rotation )

      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls.Basic
      
      Window {
          id: window
          width: 640
          height: 480
          visible: true
      
          property int virtualWidth: (window.contentOrientation === Qt.PortraitOrientation || window.contentOrientation === Qt.InvertedPortraitOrientation) ? window.height : window.width
          property int virtualHeight: (window.contentOrientation === Qt.PortraitOrientation || window.contentOrientation === Qt.InvertedPortraitOrientation) ? window.width : window.height
      
          // This is supposed to make it work, as hinted by https://doc.qt.io/qt-6/qml-qtquick-controls-popup.html#popup-sizing
          Overlay.overlay.width: window.virtualWidth
          Overlay.overlay.height: window.virtualHeight
          Overlay.overlay.anchors.centerIn: window.contentItem
      
          Item {
              id: container
              width: window.virtualWidth
              height: window.virtualHeight
              anchors.centerIn: parent
              
              // ...
          }
      }
      

       

      Expected Outcomes

      As soon as the Window is rotated, the Overlay is also updated and all Popups work nicely.

       

      Actual Outcomes

      Rotating the Window does not cause the Overlay to update. Popups don't work nicely.

       

      Other observations (which might illuminate the root cause of the issue)

      • If I resize the window slightly, I can "kick" the Overlay into the desired geometry/position and get nice Popups.
      • However, this does not last. If I resize continuously, the Overlay flickers between "good" and "bad" states

       

      These observations suggest that the custom bindings that I applied to Overlay.overlay are not being respected. Something keeps fighting my bindings.


      Attachments

        Issue Links

          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:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes