Important: Please read the Qt Code of Conduct -

QAction still triggered by keyboard shortcut when disabled.

  • Hello!

    In qt-5.11.0 it looks like a disabled QAction will still be triggered by typing its keyboard shortcut. The docs say otherwise.

    Any thoughts on this? I am using the main menu for QMainWindow on macOS.


  • @patrickkidd

    Probably you need to show the code snippet on the section disabling the keyboard shortcut.

    Also did you rerun qmake and a rebuild?

  • @koahnig Yes, I have cleaned the project for sure.

        allActionsEnabled = self.activeLicense() is not None
        actions = \
            self.ui.menuFile.findChildren(QAction) + \
            self.ui.menuEdit.findChildren(QAction) + \
            self.ui.menuView.findChildren(QAction) + \
        for action in actions:
            if action != self.ui.actionQuit:

Log in to reply