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

[REG 5.15.0 -> 5.15.1] Qt.labs.platform.MenuItem is triggering shortcut even in disabled state

    XMLWordPrintable

Details

    • Windows
    • acf2ed0c5f (qt/qtdeclarative/dev) acf2ed0c5f (qt/tqtc-qtdeclarative/dev) cd556bfef0 (qt/qtdeclarative/6.4) 235d683489 (qt/qtdeclarative/6.3) 235d683489 (qt/tqtc-qtdeclarative/6.3) cd556bfef0 (qt/tqtc-qtdeclarative/6.4)

    Description

      When Qt labs Platform MenuItem is used, the shortcut is triggered in both enabled/disabled states. This is causing incorrect behaviour for apps, which are using labs menus.
      A minimal project with a bug attached.

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      import Qt.labs.platform 1.1 as Platform
      
      ApplicationWindow {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          Action {
      //        enabled: false
              shortcut: "Ctrl+C"
              onTriggered: console.log("firing is expected")
          }
      
          Platform.Menu {
              Platform.MenuItem {
                  enabled: false
                  shortcut: "Ctrl+C"
                  text: "test"
                  onTriggered: console.log("why this fires?")
              }
          }
      }
      

      Attachments

        Issue Links

          Activity

            People

              mitch_curtis Mitch Curtis
              headhunter Roman Lazurak
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: