If a menu contains a QAction with a shortcut, but the QAction is disabled, the keypress event associated with that shortcut is delivered to whatever widget has the focus.
I have attached a sample application with a QMainWindow containing a QPlainTextEdit. The Edit menu has a single item, "Do Something" that triggers a QMessageBox. The action has the shortcut cmd-d. There is also a checkbox to enable or disable the menu item.
With the checkbox turned on (menu item enabled) when you press Cmd-d the message box appears. With the checkbox turned off (menu item disabled) when you press Cmd-d a "d" appears in the QPlainTextEdit.
When built with Qt 4.8.6, the disabled menu item does not cause characters to be added to the QPlainTextEdit.