Pass correct argument to QShortcutEvent ctor in tst_qabstractbutton.cpp
authorMitch Curtis <mitch.curtis@nokia.com>
Mon, 17 Sep 2012 15:11:16 +0000 (17:11 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 19 Sep 2012 17:54:44 +0000 (19:54 +0200)
The QShortcutEvent constructor takes "int shortcutId" as its second
argument, not a bool. Since the default shortcutId is 0, this test
passed, since false == 0.

Change-Id: I43bbae4613f3badb1578dccec76dcdd3c96a3a2f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp

index 85cd2a8..56578b0 100644 (file)
@@ -544,7 +544,8 @@ void tst_QAbstractButton::shortcutEvents()
 
     for (int i = 0; i < 4; ++i) {
         QKeySequence sequence;
-        QShortcutEvent event(sequence, false);
+        // Default shortcutId for QAbstractButton is 0, so the shortcut event will work.
+        QShortcutEvent event(sequence, /*shortcutId*/ 0);
         QApplication::sendEvent(&button, &event);
         if (i < 2)
             QTest::qWait(500);