Check QAction enablement before triggering
QAction::trigger does not check enablement. File manager's undo action gets enabled/disabled depending on whether we have anything to undo.
If we unconditionally invoke the method we can crash.
As an aside, the comment about QQuickItem and shortcut looks very outdated.