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

popupType "Popup.Window" does not respect modal property

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.1
    • None
    • Windows

    Description

      Clicks behave inconsistently between Popup.Item and Popup.Window. Specifically, when using Popup.Item, the modal property prevents clicks from "going through" to the underlying item. However, when using Popup.Window, clicks bypass the modal behavior and interact with the underlying mouse area, contrary to expected behavior.

      Expected Behavior:

      When the modal property is enabled, interacting with the popup should require two clicks:

      The first click to close the popup.
      A second, separate click to interact with the underlying item.

      I've attached a video that showcases the problem.

      Actual Behavior:

      With the modal property enabled, the first click both closes the popup and interacts with the underlying item in a single action, bypassing the expected separation of events.
       

      import QtQuick
      import QtQuick.Controls.Material
      
      ApplicationWindow {
          id: root
      
          width: 640
          height: 480
          visible: true
      
          color: "#fff0f1"
      
          Menu {
              id: someMenu
      
              // popupType: Popup.Item       // <- toggle here
              popupType: Popup.Window     // <- toggle here
      
              modal: true
              dim: false
      
              Action {
                  text: qsTr("Press me")
              }
          }
      
          MouseArea {
              anchors.fill: root.contentItem
      
              onPressed: {
                  root.color = "#7b4e7f"
              }
      
              onReleased: {
                  root.color = "#fff0f1"
              }
          }
      
          Button {
              text: `Click to open Menu`
              anchors.centerIn: root.contentItem
      
              onClicked: {
                  someMenu.open()
              }
          }
      
      }
      

      Attachments

        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
            trin94 Elias Müller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes