summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-08-30 22:06:17 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-09-05 20:41:43 +0200
commita42a4513398a159e4f6749fbcb1309c4a42b4841 (patch)
treeb1d654b4c73f23186fd0e529d1e04b1c10677e93 /tests
parent15edba41014690332f4753f932fa7d928096cb73 (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 'tests')
-rw-r--r--tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
index 2c9295d995..53753e195a 100644
--- a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
+++ b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
@@ -123,6 +123,7 @@ private slots:
void context();
void duplicatedShortcutOverride();
void shortcutToFocusProxy();
+ void deleteLater();
protected:
static Qt::KeyboardModifiers toButtons( int key );
@@ -1305,5 +1306,14 @@ void tst_QShortcut::shortcutToFocusProxy()
QCOMPARE(le.text(), QString());
}
+void tst_QShortcut::deleteLater()
+{
+ QWidget w;
+ QPointer<QShortcut> sc(new QShortcut(QKeySequence(Qt::Key_1), &w));
+ sc->deleteLater();
+ QTRY_VERIFY(!sc);
+}
+
+
QTEST_MAIN(tst_QShortcut)
#include "tst_qshortcut.moc"