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

Nested non-modal popups won't close when pressing inside the parent popup with CloseOnReleaseOutside

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9
    • Quick: Controls 2
    • None
    • All

    Description

      To reproduce, run the following code snippet:

      import QtQuick
      import QtQuick.Controls
      
      Window {
          width: 1080
          height: 720
          visible: true
          title: qsTr("Non-modal CloseOnReleaseOutside bug")
          Button {
              id: button
              anchors.centerIn: parent
              text: "Open popups"
              onClicked: function() {
                  popup1.open()
                  popup2.open()
              }
          }
          Popup {
              id: popup1
              anchors.centerIn: parent
              width: 500
              height: 500
              dim: false
              modal: false
              objectName: "Popup1"
              closePolicy: Popup.CloseOnReleaseOutside
      
              Text {
                  anchors.centerIn: parent
                  text: "Popup1"
              }
      
              Text {
                  y: 0
                  x: 0
                  text: "Clicking here should normally close Popup2"
              }
              Popup {
                  id: popup2
                  anchors.centerIn: parent
                  width: 400
                  height: 400
                  dim: false
                  modal: false // It works if modal = true
                  objectName: "Popup2"
                  closePolicy: Popup.CloseOnReleaseOutside
      
                  Text {
                      anchors.centerIn: parent
                      text: "Popup2"
                  }
              }
          }
      }

      Clicking inside Popup1 should close Popup2, which happens if Popup2 is modal, but nothing happens when it's not.

      The dim property has no impact on any of this.
      Both popups close when clicking the overlay.

      Attachments

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

        Activity

          People

            hurlevent Oliver Eftevaag
            hurlevent Oliver Eftevaag
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes