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/kernel | |
parent | 7a6c6da2ebbfef33f7284ce5c96aa0c3acabc6bc (diff) | |
parent | bac999f38ca10147832846f6d7df1e4a051d3760 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
Diffstat (limited to 'tests/auto/widgets/kernel')
12 files changed, 167 insertions, 347 deletions
diff --git a/tests/auto/widgets/kernel/kernel.pro b/tests/auto/widgets/kernel/kernel.pro index 15fcf99765..9cd666ca4f 100644 --- a/tests/auto/widgets/kernel/kernel.pro +++ b/tests/auto/widgets/kernel/kernel.pro @@ -1,7 +1,5 @@ TEMPLATE=subdirs SUBDIRS=\ - qaction \ - qactiongroup \ qapplication \ qboxlayout \ qdesktopwidget \ @@ -13,7 +11,6 @@ SUBDIRS=\ qtooltip \ qwidget \ qwidget_window \ - qwidgetaction \ qwidgetmetatype \ qwidgetsvariant \ qwindowcontainer \ @@ -22,3 +19,11 @@ SUBDIRS=\ darwin:SUBDIRS -= \ qgesturerecognizer \ + +!qtConfig(action):SUBDIRS -= \ + qaction \ + qactiongroup \ + qwidgetaction + +!qtConfig(shortcut): SUBDIRS -= \ + qshortcut diff --git a/tests/auto/widgets/kernel/qaction/.gitignore b/tests/auto/widgets/kernel/qaction/.gitignore deleted file mode 100644 index bf81f5bf2c..0000000000 --- a/tests/auto/widgets/kernel/qaction/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tst_qaction diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp index 0d62c2cd4b..cf8539da68 100644 --- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp +++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp @@ -35,6 +35,7 @@ #include <qaction.h> #include <qmenu.h> #include <qpa/qplatformtheme.h> +#include <qpa/qplatformintegration.h> #include <private/qguiapplication_p.h> class tst_QAction : public QObject @@ -49,30 +50,25 @@ public: private slots: void init(); void cleanup(); - void getSetCheck(); - void setText_data(); - void setText(); - void setIconText_data() { setText_data(); } - void setIconText(); void setUnknownFont(); void actionEvent(); - void setStandardKeys(); +#if QT_CONFIG(shortcut) void alternateShortcuts(); void enabledVisibleInteraction(); - void task200823_tooltip(); - void task229128TriggeredSignalWithoutActiongroup(); +#endif void task229128TriggeredSignalWhenInActiongroup(); +#if QT_CONFIG(shortcut) void repeat(); - void setData(); void keysequence(); // QTBUG-53381 void disableShortcutsWithBlockedWidgets_data(); void disableShortcutsWithBlockedWidgets(); void shortcutFromKeyEvent(); // QTBUG-48325 +#endif private: QEvent::Type m_lastEventType; const int m_keyboardScheme; - QAction *m_lastAction; + QGuiAction *m_lastAction; }; tst_QAction::tst_QAction() @@ -91,33 +87,6 @@ void tst_QAction::cleanup() QVERIFY(QApplication::topLevelWidgets().isEmpty()); } -// Testing get/set functions -void tst_QAction::getSetCheck() -{ - QAction obj1(nullptr); - // QActionGroup * QAction::actionGroup() - // void QAction::setActionGroup(QActionGroup *) - QActionGroup *var1 = new QActionGroup(nullptr); - obj1.setActionGroup(var1); - QCOMPARE(var1, obj1.actionGroup()); - obj1.setActionGroup(nullptr); - QCOMPARE(obj1.actionGroup(), nullptr); - delete var1; - - // QMenu * QAction::menu() - // void QAction::setMenu(QMenu *) - QMenu *var2 = new QMenu(nullptr); - obj1.setMenu(var2); - QCOMPARE(var2, obj1.menu()); - obj1.setMenu(nullptr); - QCOMPARE(obj1.menu(), nullptr); - delete var2; - - QCOMPARE(obj1.priority(), QAction::NormalPriority); - obj1.setPriority(QAction::LowPriority); - QCOMPARE(obj1.priority(), QAction::LowPriority); -} - class MyWidget : public QWidget { Q_OBJECT @@ -132,43 +101,6 @@ private: tst_QAction *m_test; }; -void tst_QAction::setText_data() -{ - QTest::addColumn<QString>("text"); - QTest::addColumn<QString>("iconText"); - QTest::addColumn<QString>("textFromIconText"); - - //next we fill it with data - QTest::newRow("Normal") << "Action" << "Action" << "Action"; - QTest::newRow("Ampersand") << "Search && Destroy" << "Search & Destroy" << "Search && Destroy"; - QTest::newRow("Mnemonic and ellipsis") << "O&pen File ..." << "Open File" << "Open File"; -} - -void tst_QAction::setText() -{ - QFETCH(QString, text); - - QAction action(nullptr); - action.setText(text); - - QCOMPARE(action.text(), text); - - QFETCH(QString, iconText); - QCOMPARE(action.iconText(), iconText); -} - -void tst_QAction::setIconText() -{ - QFETCH(QString, iconText); - - QAction action(nullptr); - action.setIconText(iconText); - QCOMPARE(action.iconText(), iconText); - - QFETCH(QString, textFromIconText); - QCOMPARE(action.text(), textFromIconText); -} - void tst_QAction::setUnknownFont() // QTBUG-42728 { QAction action(nullptr); @@ -220,34 +152,7 @@ void tst_QAction::actionEvent() QCOMPARE(m_lastAction, &a); } -//basic testing of standard keys -void tst_QAction::setStandardKeys() -{ - QAction act(nullptr); - act.setShortcut(QKeySequence("CTRL+L")); - QList<QKeySequence> list; - act.setShortcuts(list); - act.setShortcuts(QKeySequence::Copy); - QCOMPARE(act.shortcut(), act.shortcuts().constFirst()); - - QList<QKeySequence> expected; - const QKeySequence ctrlC = QKeySequence(QStringLiteral("CTRL+C")); - const QKeySequence ctrlInsert = QKeySequence(QStringLiteral("CTRL+INSERT")); - switch (m_keyboardScheme) { - case QPlatformTheme::MacKeyboardScheme: - expected << ctrlC; - break; - case QPlatformTheme::WindowsKeyboardScheme: - expected << ctrlC << ctrlInsert; - break; - default: // X11 - expected << ctrlC << ctrlInsert << QKeySequence(QStringLiteral("F16")); - break; - } - - QCOMPARE(act.shortcuts(), expected); -} - +#if QT_CONFIG(shortcut) void tst_QAction::alternateShortcuts() { @@ -353,38 +258,7 @@ void tst_QAction::enabledVisibleInteraction() QCOMPARE(spy.count(), 1); //act is visible and enabled, so trigger } -void tst_QAction::task200823_tooltip() -{ - const QScopedPointer<QAction> action(new QAction("foo", nullptr)); - QString shortcut("ctrl+o"); - action->setShortcut(shortcut); - - // we want a non-standard tooltip that shows the shortcut - action->setToolTip(action->text() + QLatin1String(" (") + action->shortcut().toString() + QLatin1Char(')')); - - QString ref = QLatin1String("foo (") + QKeySequence(shortcut).toString() + QLatin1Char(')'); - QCOMPARE(action->toolTip(), ref); -} - -void tst_QAction::task229128TriggeredSignalWithoutActiongroup() -{ - // test without a group - const QScopedPointer<QAction> actionWithoutGroup(new QAction("Test", nullptr)); - QSignalSpy spyWithoutGroup(actionWithoutGroup.data(), QOverload<bool>::of(&QAction::triggered)); - QCOMPARE(spyWithoutGroup.count(), 0); - actionWithoutGroup->trigger(); - // signal should be emitted - QCOMPARE(spyWithoutGroup.count(), 1); - - // it is now a checkable checked action - actionWithoutGroup->setCheckable(true); - actionWithoutGroup->setChecked(true); - spyWithoutGroup.clear(); - QCOMPARE(spyWithoutGroup.count(), 0); - actionWithoutGroup->trigger(); - // signal should be emitted - QCOMPARE(spyWithoutGroup.count(), 1); -} +#endif // QT_CONFIG(shortcut) void tst_QAction::task229128TriggeredSignalWhenInActiongroup() { @@ -407,8 +281,13 @@ void tst_QAction::task229128TriggeredSignalWhenInActiongroup() QCOMPARE(actionSpy.count(), 1); } +#if QT_CONFIG(shortcut) + void tst_QAction::repeat() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + MyWidget testWidget(this); testWidget.show(); QApplication::setActiveWindow(&testWidget); @@ -448,21 +327,6 @@ void tst_QAction::repeat() QCOMPARE(spy.count(), 2); } -void tst_QAction::setData() // QTBUG-62006 -{ - QAction act(nullptr); - QSignalSpy spy(&act, &QAction::changed); - QCOMPARE(act.data(), QVariant()); - QCOMPARE(spy.count(), 0); - act.setData(QVariant()); - QCOMPARE(spy.count(), 0); - - act.setData(-1); - QCOMPARE(spy.count(), 1); - act.setData(-1); - QCOMPARE(spy.count(), 1); -} - void tst_QAction::disableShortcutsWithBlockedWidgets_data() { QTest::addColumn<Qt::ShortcutContext>("shortcutContext"); @@ -484,6 +348,9 @@ void tst_QAction::disableShortcutsWithBlockedWidgets_data() void tst_QAction::disableShortcutsWithBlockedWidgets() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + QMainWindow window; QFETCH(Qt::ShortcutContext, shortcutContext); @@ -528,6 +395,9 @@ protected: // ShortcutOverride event first before passing it on as a normal KeyEvent. void tst_QAction::shortcutFromKeyEvent() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + ShortcutOverrideWidget testWidget; QAction action; action.setShortcut(Qt::Key_1); @@ -546,5 +416,7 @@ void tst_QAction::shortcutFromKeyEvent() QCOMPARE(testWidget.shortcutOverrideCount, 1); } +#endif // QT_CONFIG(shortcut) + QTEST_MAIN(tst_QAction) #include "tst_qaction.moc" diff --git a/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp b/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp index 524040d003..d3b07ba26a 100644 --- a/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp +++ b/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp @@ -38,166 +38,9 @@ class tst_QActionGroup : public QObject private slots: void cleanup() { QVERIFY(QApplication::topLevelWidgets().isEmpty()); } - void enabledPropagation(); - void visiblePropagation(); - void exclusive(); - void exclusiveOptional(); void separators(); - void testActionInTwoQActionGroup(); - void unCheckCurrentAction(); }; -void tst_QActionGroup::enabledPropagation() -{ - QActionGroup testActionGroup(nullptr); - - QAction* childAction = new QAction( &testActionGroup ); - QAction* anotherChildAction = new QAction( &testActionGroup ); - QAction* freeAction = new QAction(nullptr); - - QVERIFY( testActionGroup.isEnabled() ); - QVERIFY( childAction->isEnabled() ); - - testActionGroup.setEnabled( false ); - QVERIFY( !testActionGroup.isEnabled() ); - QVERIFY( !childAction->isEnabled() ); - QVERIFY( !anotherChildAction->isEnabled() ); - - childAction->setEnabled(true); - QVERIFY( !childAction->isEnabled()); - - anotherChildAction->setEnabled( false ); - - testActionGroup.setEnabled( true ); - QVERIFY( testActionGroup.isEnabled() ); - QVERIFY( childAction->isEnabled() ); - QVERIFY( !anotherChildAction->isEnabled() ); - - testActionGroup.setEnabled( false ); - QAction *lastChildAction = new QAction(&testActionGroup); - - QVERIFY(!lastChildAction->isEnabled()); - testActionGroup.setEnabled( true ); - QVERIFY(lastChildAction->isEnabled()); - - freeAction->setEnabled(false); - testActionGroup.addAction(freeAction); - QVERIFY(!freeAction->isEnabled()); - delete freeAction; -} - -void tst_QActionGroup::visiblePropagation() -{ - QActionGroup testActionGroup(nullptr); - - QAction* childAction = new QAction( &testActionGroup ); - QAction* anotherChildAction = new QAction( &testActionGroup ); - QAction* freeAction = new QAction(nullptr); - - QVERIFY( testActionGroup.isVisible() ); - QVERIFY( childAction->isVisible() ); - - testActionGroup.setVisible( false ); - QVERIFY( !testActionGroup.isVisible() ); - QVERIFY( !childAction->isVisible() ); - QVERIFY( !anotherChildAction->isVisible() ); - - anotherChildAction->setVisible(false); - - testActionGroup.setVisible( true ); - QVERIFY( testActionGroup.isVisible() ); - QVERIFY( childAction->isVisible() ); - - QVERIFY( !anotherChildAction->isVisible() ); - - testActionGroup.setVisible( false ); - QAction *lastChildAction = new QAction(&testActionGroup); - - QVERIFY(!lastChildAction->isVisible()); - testActionGroup.setVisible( true ); - QVERIFY(lastChildAction->isVisible()); - - freeAction->setVisible(false); - testActionGroup.addAction(freeAction); - QVERIFY(!freeAction->isVisible()); - delete freeAction; -} - -void tst_QActionGroup::exclusive() -{ - QActionGroup group(nullptr); - group.setExclusive(false); - QVERIFY( !group.isExclusive() ); - - QAction* actOne = new QAction( &group ); - actOne->setCheckable( true ); - QAction* actTwo = new QAction( &group ); - actTwo->setCheckable( true ); - QAction* actThree = new QAction( &group ); - actThree->setCheckable( true ); - - group.setExclusive( true ); - QVERIFY( !actOne->isChecked() ); - QVERIFY( !actTwo->isChecked() ); - QVERIFY( !actThree->isChecked() ); - - actOne->setChecked( true ); - QVERIFY( actOne->isChecked() ); - QVERIFY( !actTwo->isChecked() ); - QVERIFY( !actThree->isChecked() ); - - actTwo->setChecked( true ); - QVERIFY( !actOne->isChecked() ); - QVERIFY( actTwo->isChecked() ); - QVERIFY( !actThree->isChecked() ); -} - -void tst_QActionGroup::exclusiveOptional() -{ - QActionGroup group(0); - group.setExclusive(true); - QVERIFY( group.isExclusive() ); - - QAction* actOne = new QAction( &group ); - actOne->setCheckable( true ); - QAction* actTwo = new QAction( &group ); - actTwo->setCheckable( true ); - QAction* actThree = new QAction( &group ); - actThree->setCheckable( true ); - - QVERIFY( !actOne->isChecked() ); - QVERIFY( !actTwo->isChecked() ); - QVERIFY( !actThree->isChecked() ); - - actOne->trigger(); - QVERIFY( actOne->isChecked() ); - QVERIFY( !actTwo->isChecked() ); - QVERIFY( !actThree->isChecked() ); - - actOne->trigger(); - QVERIFY( actOne->isChecked() ); - QVERIFY( !actTwo->isChecked() ); - QVERIFY( !actThree->isChecked() ); - - group.setExclusionPolicy( QActionGroup::ExclusionPolicy::ExclusiveOptional ); - QVERIFY( group.isExclusive() ); - - actOne->trigger(); - QVERIFY( !actOne->isChecked() ); - QVERIFY( !actTwo->isChecked() ); - QVERIFY( !actThree->isChecked() ); - - actTwo->trigger(); - QVERIFY( !actOne->isChecked() ); - QVERIFY( actTwo->isChecked() ); - QVERIFY( !actThree->isChecked() ); - - actTwo->trigger(); - QVERIFY( !actOne->isChecked() ); - QVERIFY( !actTwo->isChecked() ); - QVERIFY( !actThree->isChecked() ); -} - void tst_QActionGroup::separators() { QMainWindow mw; @@ -233,40 +76,5 @@ void tst_QActionGroup::separators() QCOMPARE(menu.actions().size(), 3); } -void tst_QActionGroup::testActionInTwoQActionGroup() -{ - QAction action1("Action 1", this); - - QActionGroup group1(this); - QActionGroup group2(this); - - group1.addAction(&action1); - group2.addAction(&action1); - - QCOMPARE(action1.actionGroup(), &group2); - QCOMPARE(group2.actions().first(), &action1); - QCOMPARE(group1.actions().isEmpty(), true); -} - -void tst_QActionGroup::unCheckCurrentAction() -{ - QActionGroup group(nullptr); - QAction action1(&group) ,action2(&group); - action1.setCheckable(true); - action2.setCheckable(true); - QVERIFY(!action1.isChecked()); - QVERIFY(!action2.isChecked()); - action1.setChecked(true); - QVERIFY(action1.isChecked()); - QVERIFY(!action2.isChecked()); - QAction *current = group.checkedAction(); - QCOMPARE(current, &action1); - current->setChecked(false); - QVERIFY(!action1.isChecked()); - QVERIFY(!action2.isChecked()); - QVERIFY(!group.checkedAction()); -} - - QTEST_MAIN(tst_QActionGroup) #include "tst_qactiongroup.moc" diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 367a5767c4..8a5eff3fac 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -1704,6 +1704,9 @@ void tst_QApplication::focusMouseClick() int argc = 1; QApplication app(argc, &argv0); + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + QWidget w; w.setWindowTitle(QLatin1String(QTest::currentTestFunction())); w.setFocusPolicy(Qt::StrongFocus); diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp index c6760000f4..45a35fe4f1 100644 --- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp +++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp @@ -99,7 +99,9 @@ class tst_QFormLayout : public QObject private slots: void cleanup(); void rowCount(); +#if QT_CONFIG(shortcut) void buddies(); +#endif void getItemPosition(); void wrapping(); void spacing(); @@ -190,6 +192,8 @@ void tst_QFormLayout::rowCount() //TODO: remove items } +#if QT_CONFIG(shortcut) + void tst_QFormLayout::buddies() { QWidget w; @@ -218,6 +222,8 @@ void tst_QFormLayout::buddies() //TODO: empty label? } +#endif // QT_CONFIG(shortcut) + void tst_QFormLayout::getItemPosition() { QWidget w; @@ -687,17 +693,21 @@ void tst_QFormLayout::insertRow_QString_QWidget() layout->insertRow(-5, "&Name:", fld1); QLabel *label1 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget()); QVERIFY(label1 != 0); +#if QT_CONFIG(shortcut) QCOMPARE(label1->buddy(), fld1); - +#endif layout->insertRow(0, "&Email:", fld2); QLabel *label2 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget()); QVERIFY(label2 != 0); +#if QT_CONFIG(shortcut) QCOMPARE(label2->buddy(), fld2); - +#endif layout->insertRow(5, "&Age:", fld3); QLabel *label3 = qobject_cast<QLabel *>(layout->itemAt(2, QFormLayout::LabelRole)->widget()); QVERIFY(label3 != 0); +#if QT_CONFIG(shortcut) QCOMPARE(label3->buddy(), fld3); +#endif } void tst_QFormLayout::insertRow_QString_QLayout() @@ -711,21 +721,27 @@ void tst_QFormLayout::insertRow_QString_QLayout() layout->insertRow(-5, "&Name:", fld1); QLabel *label1 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget()); QVERIFY(label1 != 0); +#if QT_CONFIG(shortcut) QVERIFY(!label1->buddy()); +#endif QCOMPARE(layout->rowCount(), 1); layout->insertRow(0, "&Email:", fld2); QLabel *label2 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget()); QVERIFY(label2 != 0); +#if QT_CONFIG(shortcut) QVERIFY(!label2->buddy()); +#endif QCOMPARE(layout->rowCount(), 2); layout->insertRow(5, "&Age:", fld3); QLabel *label3 = qobject_cast<QLabel *>(layout->itemAt(2, QFormLayout::LabelRole)->widget()); QVERIFY(label3 != 0); +#if QT_CONFIG(shortcut) QVERIFY(!label3->buddy()); +#endif QCOMPARE(layout->rowCount(), 3); } diff --git a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp index 84120c70e9..82ab9c9c3b 100644 --- a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp +++ b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp @@ -612,6 +612,9 @@ ButtonWidget::ButtonWidget() // ------------------------------------------------------------------ void tst_QShortcut::disabledItems() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + ButtonWidget mainW; mainW.setWindowTitle(QTest::currentTestFunction()); mainW.show(); @@ -692,6 +695,9 @@ void tst_QShortcut::disabledItems() // ------------------------------------------------------------------ void tst_QShortcut::ambiguousRotation() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + MainWindow mainW; const QString name = QLatin1String(QTest::currentTestFunction()); mainW.setWindowTitle(name); @@ -834,6 +840,9 @@ void tst_QShortcut::ambiguousRotation() void tst_QShortcut::ambiguousItems() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + ButtonWidget mainW; mainW.setWindowTitle(QTest::currentTestFunction()); mainW.show(); @@ -874,6 +883,9 @@ void tst_QShortcut::ambiguousItems() // ------------------------------------------------------------------ void tst_QShortcut::unicodeCompare() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + ButtonWidget mainW; mainW.setWindowTitle(QTest::currentTestFunction()); mainW.show(); @@ -906,6 +918,9 @@ void tst_QShortcut::unicodeCompare() // ------------------------------------------------------------------ void tst_QShortcut::keypressConsumption() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + MainWindow mainW; mainW.setWindowTitle(QTest::currentTestFunction()); mainW.show(); @@ -1099,6 +1114,9 @@ public: void tst_QShortcut::duplicatedShortcutOverride() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + OverrideCountingWidget w; w.setWindowTitle(Q_FUNC_INFO); w.resize(200, 200); @@ -1199,6 +1217,9 @@ void tst_QShortcut::sendKeyEvents(QWidget *w, int k1, QChar c1, int k2, QChar c2 void tst_QShortcut::testElement() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + static QScopedPointer<MainWindow> mainW; currentResult = NoResult; @@ -1243,6 +1264,9 @@ void tst_QShortcut::testElement() void tst_QShortcut::shortcutToFocusProxy() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QLineEdit le; QCompleter completer; QStringListModel *slm = new QStringListModel(QStringList() << "a0" << "a1" << "a2", &completer); diff --git a/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp b/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp index 10712ea9ad..053dc03296 100644 --- a/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp +++ b/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp @@ -92,6 +92,9 @@ tst_QStackedLayout::tst_QStackedLayout() void tst_QStackedLayout::init() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + if (testWidget) { delete testWidget; testWidget = 0; diff --git a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp index 3d609d0b9c..053f4948a7 100644 --- a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp +++ b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp @@ -96,6 +96,9 @@ void tst_QToolTip::task183679_data() void tst_QToolTip::task183679() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QFETCH(Qt::Key, key); QFETCH(bool, visible); @@ -200,6 +203,9 @@ static QByteArray msgSizeTooSmall(const QSize &actual, const QSize &expected) // Set a large font size and verify that the tool tip is big enough. void tst_QToolTip::qtbug64550_stylesheet() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + Widget_task183679 widget; widget.setStyleSheet(QStringLiteral("* { font-size: 48pt; }\n")); widget.show(); diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 40377eb946..c29d1bbe04 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -858,6 +858,9 @@ void tst_QWidget::palettePropagation() void tst_QWidget::palettePropagation2() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + // ! Note, the code below is executed in tst_QWidget's constructor. // QPalette palette; // font.setColor(QPalette::ToolTipBase, QColor(12, 13, 14)); @@ -1018,6 +1021,9 @@ void tst_QWidget::ignoreKeyEventsWhenDisabled_QTBUG27417() void tst_QWidget::properTabHandlingWhenDisabled_QTBUG27417() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QWidget widget; widget.setWindowTitle(__FUNCTION__); widget.setMinimumWidth(m_testWidgetSize.width()); @@ -1679,6 +1685,9 @@ public: void tst_QWidget::defaultTabOrder() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + const int compositeCount = 2; Container container; Composite *composite[compositeCount]; @@ -1733,6 +1742,9 @@ void tst_QWidget::defaultTabOrder() void tst_QWidget::reverseTabOrder() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + const int compositeCount = 2; Container container; container.setWindowTitle(QLatin1String(QTest::currentTestFunction())); @@ -1792,6 +1804,9 @@ void tst_QWidget::reverseTabOrder() void tst_QWidget::tabOrderWithProxy() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + const int compositeCount = 2; Container container; container.setWindowTitle(QLatin1String(QTest::currentTestFunction())); @@ -1850,6 +1865,9 @@ void tst_QWidget::tabOrderWithProxy() void tst_QWidget::tabOrderWithCompoundWidgets() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + const int compositeCount = 4; Container container; container.setWindowTitle(QLatin1String(QTest::currentTestFunction())); @@ -2038,6 +2056,9 @@ void tst_QWidget::tabOrderNoChange2() void tst_QWidget::appFocusWidgetWithFocusProxyLater() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + // Given a lineedit without a focus proxy QWidget window; window.setWindowTitle(QTest::currentTestFunction()); @@ -2062,6 +2083,9 @@ void tst_QWidget::appFocusWidgetWithFocusProxyLater() void tst_QWidget::appFocusWidgetWhenLosingFocusProxy() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + // Given a lineedit with a focus proxy QWidget window; window.setWindowTitle(QTest::currentTestFunction()); @@ -3974,6 +3998,9 @@ void tst_QWidget::optimizedResizeMove() void tst_QWidget::optimizedResize_topLevel() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + if (QHighDpiScaling::isActive()) QSKIP("Skip due to rounding errors in the regions."); StaticWidget topLevel; @@ -4089,6 +4116,9 @@ void tst_QWidget::setMaximumSize() void tst_QWidget::setFixedSize() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QWidget w; QSize defaultSize = w.size(); @@ -5638,6 +5668,9 @@ public: void tst_QWidget::setFocus() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + QScopedPointer<QWidget> testWidget(new QWidget); testWidget->resize(m_testWidgetSize); testWidget->setWindowTitle(__FUNCTION__); @@ -8885,6 +8918,9 @@ public: void tst_QWidget::translucentWidget() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QPixmap pm(16,16); pm.fill(Qt::red); ColorRedWidget label; @@ -8954,6 +8990,9 @@ public slots: void tst_QWidget::setClearAndResizeMask() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + UpdateWidget topLevel; topLevel.setWindowTitle(QLatin1String(QTest::currentTestFunction())); topLevel.resize(160, 160); @@ -9522,6 +9561,9 @@ void tst_QWidget::updateOnDestroyedSignal() void tst_QWidget::toplevelLineEditFocus() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QLineEdit w; w.setWindowTitle(QLatin1String(QTest::currentTestFunction())); w.setMinimumWidth(m_testWidgetSize.width()); @@ -9974,6 +10016,9 @@ void tst_QWidget::taskQTBUG_17333_ResizeInfiniteRecursion() void tst_QWidget::nativeChildFocus() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QWidget w; w.setWindowTitle(QLatin1String(QTest::currentTestFunction())); w.setMinimumWidth(m_testWidgetSize.width()); @@ -10112,6 +10157,9 @@ private: void tst_QWidget::grabMouse() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QStringList log; GrabLoggerWidget w(&log); w.setWindowTitle(QLatin1String(QTest::currentTestFunction())); @@ -10147,6 +10195,9 @@ void tst_QWidget::grabMouse() void tst_QWidget::grabKeyboard() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QWidget w; w.setWindowTitle(QLatin1String(QTest::currentTestFunction())); w.setObjectName(QLatin1String("tst_qwidget_grabKeyboard")); diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp index c6b5669965..7d114fde56 100644 --- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp +++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp @@ -411,6 +411,9 @@ void tst_QWidget_window::tst_paintEventOnSecondShow() void tst_QWidget_window::tst_exposeObscuredMapped_QTBUG39220() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + const auto integration = QGuiApplicationPrivate::platformIntegration(); if (!integration->hasCapability(QPlatformIntegration::MultipleWindows) || !integration->hasCapability(QPlatformIntegration::NonFullScreenWindows) @@ -438,6 +441,9 @@ void tst_QWidget_window::tst_exposeObscuredMapped_QTBUG39220() void tst_QWidget_window::tst_paintEventOnResize_QTBUG50796() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + const QRect availableGeo = QGuiApplication::primaryScreen()->availableGeometry(); QWidget root; @@ -582,6 +588,9 @@ static QString msgEventAccepted(const QDropEvent &e) void tst_QWidget_window::tst_dnd() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QStringList log; DnDEventLoggerWidget dndTestWidget(&log); @@ -819,6 +828,9 @@ public: void tst_QWidget_window::tst_dnd_propagation() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QMimeData mimeData; mimeData.setText(QLatin1String("testmimetext")); @@ -1066,6 +1078,9 @@ protected: void tst_QWidget_window::tst_eventfilter_on_toplevel() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QWidget w; EventFilter filter; w.installEventFilter(&filter); @@ -1124,6 +1139,9 @@ void tst_QWidget_window::QTBUG_50561_QCocoaBackingStore_paintDevice_crash() void tst_QWidget_window::setWindowState_data() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QString platformName = QGuiApplication::platformName().toLower(); QTest::addColumn<Qt::WindowStates>("state"); diff --git a/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp b/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp index 693a792f0a..98aebfe975 100644 --- a/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp +++ b/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp @@ -93,6 +93,9 @@ void tst_QWindowContainer::cleanup() void tst_QWindowContainer::testShow() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QWidget root; root.setWindowTitle(QTest::currentTestFunction()); root.setGeometry(m_availableGeometry.x() + 100, m_availableGeometry.y() + 100, 400, 400); @@ -135,6 +138,9 @@ void tst_QWindowContainer::testPositionAndSize() void tst_QWindowContainer::testExposeObscure() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + Window *window = new Window(); QScopedPointer<QWidget> container(QWidget::createWindowContainer(window)); @@ -187,6 +193,9 @@ void tst_QWindowContainer::testBehindTheScenesDeletion() void tst_QWindowContainer::testActivation() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QWidget root; root.setWindowTitle(QTest::currentTestFunction()); @@ -244,6 +253,9 @@ void tst_QWindowContainer::testUnparenting() void tst_QWindowContainer::testUnparentReparent() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QWidget root; QWindow *window = new QWindow(); @@ -357,6 +369,9 @@ void tst_QWindowContainer::testDockWidget() void tst_QWindowContainer::testNativeContainerParent() { + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This fails. Figure out why."); + QWidget root; root.setWindowTitle(QTest::currentTestFunction()); root.setGeometry(m_availableGeometry.x() + 50, m_availableGeometry.y() + 50, 200, 200); |