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

Popup resizes to improper height on window size change

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.7.0 RC
    • 5.7.0 Alpha
    • Quick: Controls 2
    • None

    Description

      In test program, popup change own size with window aspect ratio change (i.e. landscape/portrait). In some cases it change height to wrong value.

      import QtQuick 2.6
      import Qt.labs.controls 1.0
      
      ApplicationWindow {
          id: main
      
          visible: true
          width: 640
          height: 480
      
          Popup {
              id: popup
      
              property bool isLandscape: ApplicationWindow.window.width > ApplicationWindow.window.height
              x: (ApplicationWindow.window.width - width) / 2
              y: (ApplicationWindow.window.height - height) / 2
              padding: 0
              margins: 0
              closePolicy: Popup.NoAutoClose
              contentItem: Rectangle {
                  implicitWidth: popup.isLandscape ? 400 : 200
                  implicitHeight: popup.isLandscape ? 200 : 400
                  color: "red"
                  border {
                      width: 1
                      color: "green"
                  }
              }
              Component.onCompleted: open()
              onWidthChanged: console.log("width", width)
              onHeightChanged: console.log("height", height)
          }
      }
      

      To reproduce the bug, decrease window size until rectangle change it's size and then increase. It should became almost square and get height 340 instead of 200.

      I also cannot reproduce in on 5.6.

      Attachments

        1. limit_height.png
          limit_height.png
          8 kB
        2. mobile.png
          mobile.png
          12 kB
        3. popup_resize.png
          popup_resize.png
          8 kB

        Activity

          People

            Unassigned Unassigned
            krnekit Nikita Krupenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: