summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
diff options
context:
space:
mode:
authorMaciej Czarnecki <mcczarny@gmail.com>2017-08-21 13:28:51 +0200
committerLiang Qi <liang.qi@qt.io>2017-10-24 16:43:52 +0000
commit3b8f828174f08d9037a0947b8709648ac37cdc36 (patch)
treeb494b0aa1121154b2b29136f31ef5806907a1c63 /tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
parentabcf558e49d5e8c20eda14badc30e93e2e9cba32 (diff)
QWizard: Do not remove the Next button's shortcut
Currently on Windows, the Next button's shortcut doesn't work, because QWizard overrides it with an empty key sequence. The key sequence should be changed only if isVistaThemeEnabled() returns true. Task-number: QTBUG-46894 Change-Id: I54f26388b167973cc8065a867d9e771c1e6a2a72 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp')
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
index db86fba59c..6ad93b2666 100644
--- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
+++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
@@ -96,6 +96,7 @@ private slots:
void task248107_backButton();
void task255350_fieldObjectDestroyed();
void taskQTBUG_25691_fieldObjectDestroyed2();
+ void taskQTBUG_46894_nextButtonShortcut();
/*
Things that could be added:
@@ -2700,5 +2701,24 @@ void tst_QWizard::taskQTBUG_25691_fieldObjectDestroyed2()
::taskQTBUG_25691_fieldObjectDestroyed2();
}
+void tst_QWizard::taskQTBUG_46894_nextButtonShortcut()
+{
+ for (int i = 0; i < QWizard::NStyles; ++i) {
+ QWizard wizard;
+ QWizard::WizardStyle style = static_cast<QWizard::WizardStyle>(i);
+ wizard.setWizardStyle(style);
+ wizard.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&wizard));
+
+ if (wizard.button(QWizard::NextButton)->text() == "&Next") {
+ QCOMPARE(wizard.button(QWizard::NextButton)->shortcut(),
+ QKeySequence(Qt::ALT | Qt::Key_Right));
+ } else {
+ QCOMPARE(wizard.button(QWizard::NextButton)->shortcut(),
+ QKeySequence::mnemonic(wizard.button(QWizard::NextButton)->text()));
+ }
+ }
+}
+
QTEST_MAIN(tst_QWizard)
#include "tst_qwizard.moc"