Pass correct argument to QShortcutEvent ctor in tst_qabstractbutton.cpp

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>
bb10
Mitch Curtis 2012-09-17 17:11:16 +02:00 committed by The Qt Project
parent ed116aa3b3
commit 63bc298fb3
1 changed files with 2 additions and 1 deletions

View 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);