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

Quick Popup wrong reposition

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Duplicate
    • Affects Version/s: 5.15.2
    • Fix Version/s: None
    • Component/s: Quick: Controls 2
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      Reposition breaks for Dialog from QtQuick.Controls 2.15 with overrided enter/exit Transition for scale.
      1. Push the button to open Dialog
      2. Close dialog
      3. Push the button again to open Dialog
      [Result]
      Dialog opens not centered in parent
      root of the problem caused by changes QQuickPopupPositioner::reposition() for using scale to calculate width/height of popupItem

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      
      ApplicationWindow {
          id: window
          width: 640
          height: 480
          visible: true
          title: qsTr("Stack")
      
          Dialog {
              id: dialog
              anchors.centerIn: parent
              implicitWidth: 400
              implicitHeight: 100
              enter: Transition {
                  // grow_in
                  NumberAnimation { property: "scale"; from: 0.1; to: 1.0; easing.type: Easing.OutQuint; duration: 300 }
              }
      
              exit: Transition {
                  // shrink_out
                  NumberAnimation { property: "scale"; from: 1.0; to: 0.1; easing.type: Easing.OutQuint; duration: 300 }
              }
              contentItem: Rectangle {
                  color: "lightskyblue"
                  Text {
                      text: "Hello blue sky!"
                      color: "navy"
                      anchors.centerIn: parent
                  }
              }
          }
      
          Button {
              anchors.centerIn: parent
              text: "Push me"
              onClicked: {
                  dialog.open()
              }
          }
      }
      

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              aleksey_zinovyev Aleksey Zinovyev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes