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

MenuItem: action can still be triggered with mouse when menuitem is disabled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.1.0
    • 5.1.0
    • Quick: Controls 1
    • None
    • 2f8ff3a686a7685640b686f0f4a9c3663d89fba5

    Description

      When the MenuItem is disabled, the action can still be triggered when the menu item is clicked.

      Testcase: Click the disabled menu item and the application is closed. It shouldn't.

      import QtQuick 2.0
      import QtQuick.Controls 1.0
      
      ApplicationWindow {
          width: 360
          height: 360
          menuBar : MenuBar {
              id: menubar
              Menu {
                  title: "&File"
                  MenuItem {
                      id: close
                      text: "Close"
                      shortcut: "Ctrl+Q"
                      onTriggered: { Qt.quit()}
                      enabled: false
                  }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            dedietri Gabriel de Dietrich (drgvond)
            carochao Caroline Chao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes