diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2019-11-14 13:03:46 +0100 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2019-11-19 13:53:21 +0100 |
commit | 26e876912435bdafbca2b425af43824d7ec5b876 (patch) | |
tree | b7ee83cdd9de18ce5970bab0bb217a972d3d2445 /tests/auto/widgets/widgets/qpushbutton | |
parent | 7a6c6da2ebbfef33f7284ce5c96aa0c3acabc6bc (diff) | |
parent | bac999f38ca10147832846f6d7df1e4a051d3760 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
Diffstat (limited to 'tests/auto/widgets/widgets/qpushbutton')
-rw-r--r-- | tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp index 66f4df4498..d0ed68c0c8 100644 --- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp +++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp @@ -53,7 +53,9 @@ private slots: void getSetCheck(); void autoRepeat(); void pressed(); +#if QT_CONFIG(shortcut) void setAccel(); +#endif void isCheckable(); void setDown(); void popupCrash(); @@ -65,7 +67,9 @@ private slots: void defaultAndAutoDefault(); void sizeHint_data(); void sizeHint(); +#if QT_CONFIG(shortcut) void taskQTBUG_20191_shortcutWithKeypadModifer(); +#endif void emitReleasedAfterChange(); protected slots: @@ -125,8 +129,10 @@ void tst_QPushButton::init() testWidget->setDown( false ); testWidget->setText("Test"); testWidget->setEnabled( true ); +#if QT_CONFIG(shortcut) QKeySequence seq; testWidget->setShortcut( seq ); +#endif resetCounters(); } @@ -318,6 +324,8 @@ void tst_QPushButton::toggled() QVERIFY( click_count == 1 ); } +#if QT_CONFIG(shortcut) + /* If we press an accelerator key we ONLY get a pressed signal and NOT a released or clicked signal. @@ -325,6 +333,9 @@ void tst_QPushButton::toggled() void tst_QPushButton::setAccel() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + testWidget->setText("&AccelTest"); QKeySequence seq( Qt::ALT + Qt::Key_A ); testWidget->setShortcut( seq ); @@ -346,6 +357,8 @@ void tst_QPushButton::setAccel() QTRY_VERIFY( !testWidget->isDown() ); } +#endif // QT_CONFIG(shortcut) + void tst_QPushButton::animateClick() { QVERIFY( !testWidget->isDown() ); @@ -568,6 +581,8 @@ void tst_QPushButton::sizeHint() } } +#if QT_CONFIG(shortcut) + void tst_QPushButton::taskQTBUG_20191_shortcutWithKeypadModifer() { // setup a dialog with two buttons @@ -614,6 +629,8 @@ void tst_QPushButton::taskQTBUG_20191_shortcutWithKeypadModifer() QCOMPARE(spy2.count(), 1); } +#endif // QT_CONFIG(shortcut) + void tst_QPushButton::emitReleasedAfterChange() { QPushButton *button1 = new QPushButton("A"); |