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

Dialog is closed when releasing a drag outside of it

    XMLWordPrintable

Details

    • 89b8beeced (qt/qtdeclarative/dev) 89b8beeced (qt/tqtc-qtdeclarative/dev) aa67903259 (qt/qtdeclarative/6.3) aa67903259 (qt/tqtc-qtdeclarative/6.3) aa67903259 (qt/tqtc-qtdeclarative/6.3.1)

    Description

      To reproduce, drag a slider (or any control that accepts mouse input, like a Button) in a dialog and then finish the drag by releasing outside of the dialog (happens often when quickly dragging a slider to its maximum value).

      Even though the close policy is Popup.CloseOnReleaseOutside, I wouldn't expect the dialog to close because of it in this situation.

      QML from the attached project:

      main.qml
      import QtQuick 2.8
      import QtQuick.Controls 2.1
      import QtQuick.Layouts 1.3
      
      ApplicationWindow {
          id: window
          objectName: "window"
          width: 800
          height: 800
          visible: true
      
          Button {
              id: button
              text: "Open"
              onClicked: dialog.open()
          }
      
          Dialog {
              id: dialog
              objectName: "texturedFillSettingsDialog"
              title: qsTr("Textured Fill settings")
              // Doesn't work if these are specified
              x: Math.round(parent.width - width) / 2
              y: Math.round(parent.height - height) / 2
              modal: true
              dim: false
              focus: true
              closePolicy: Popup.CloseOnEscape | Popup.CloseOnReleaseOutside
      
              contentItem: RangeSlider {
                  id: root
                  from: -1
                  to: 1
                  first.value: 0.25
                  second.value: 0.75
                  objectName: "hueVarianceSlider"
      
                  Layout.fillWidth: true
              }
          }
      }
      

      Attachments

        1. qtbug67512.gif
          qtbug67512.gif
          20 kB
        2. qtbug67512.zip
          3 kB

        Activity

          People

            soarmin Soheil Armin
            mitch_curtis Mitch Curtis
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: