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.
This commit is contained in:
parent
3f218664a5
commit
2ce8590eae
|
@ -797,6 +797,10 @@ bool AppletInterface::event(QEvent *event)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!a->isEnabled()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// this will happen on a normal, non emacs shortcut
|
||||
if (seq.matches(a->shortcut()) == QKeySequence::ExactMatch) {
|
||||
event->accept();
|
||||
|
|
Loading…
Reference in New Issue
Block a user