diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-08-30 22:06:17 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-09-05 20:41:43 +0200 |
commit | a42a4513398a159e4f6749fbcb1309c4a42b4841 (patch) | |
tree | b1d654b4c73f23186fd0e529d1e04b1c10677e93 /src/widgets/kernel | |
parent | 15edba41014690332f4753f932fa7d928096cb73 (diff) |
QShortcut: call base class implementation in event()
QShortcut::event() did not call the base class implementation
QObject::event() which caused that e.g. QEvent::DeferredDelete was not
handled.
Fix it by calling QObject::event() when the event was not handled.
Fixes: QTBUG-66809
Change-Id: Ideebc980bc658f8f2b9ec4417e738bccda5eeab5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qshortcut.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index b7857e2b74..db06dce042 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -665,24 +665,22 @@ int QShortcut::id() const bool QShortcut::event(QEvent *e) { Q_D(QShortcut); - bool handled = false; if (d->sc_enabled && e->type() == QEvent::Shortcut) { QShortcutEvent *se = static_cast<QShortcutEvent *>(e); if (se->shortcutId() == d->sc_id && se->key() == d->sc_sequence){ #if QT_CONFIG(whatsthis) if (QWhatsThis::inWhatsThisMode()) { QWhatsThis::showText(QCursor::pos(), d->sc_whatsthis); - handled = true; } else #endif if (se->isAmbiguous()) emit activatedAmbiguously(); else emit activated(); - handled = true; + return true; } } - return handled; + return QObject::event(e); } #endif // QT_NO_SHORTCUT |