summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qaction
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-10-18 09:07:37 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-10-25 12:12:39 +0200
commitdff3843d98d52e2c32fea07371f91117de0667e9 (patch)
tree028199eebf8d92722de91412e32352c54cbd5183 /tests/auto/widgets/kernel/qaction
parent5d5a0842dc87645eab468389198750adc01b0618 (diff)
QShortcut: Properly port to the new configure system
Move the feature to corelib so that the QMetaType enumeration values can be properly excluded and there is no need for a dummy class. Use QT_REQUIRE_CONFIG in the headers of classes to be disabled. Add headers/source files in the .pro file depending on the configure feature in libraries and tests. Add the necessary exclusions and use QT_CONFIG. Task-number: QTBUG-76493 Change-Id: I02499ebee1a3d6d9a1e5afd02517beed5f4536b7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/widgets/kernel/qaction')
-rw-r--r--tests/auto/widgets/kernel/qaction/tst_qaction.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
index 1247f48dd0..66a82d512d 100644
--- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
+++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
@@ -57,18 +57,24 @@ private slots:
void setIconText();
void setUnknownFont();
void actionEvent();
+#if QT_CONFIG(shortcut)
void setStandardKeys();
void alternateShortcuts();
void enabledVisibleInteraction();
void task200823_tooltip();
+#endif
void task229128TriggeredSignalWithoutActiongroup();
void task229128TriggeredSignalWhenInActiongroup();
+#if QT_CONFIG(shortcut)
void repeat();
+#endif
void setData();
+#if QT_CONFIG(shortcut)
void keysequence(); // QTBUG-53381
void disableShortcutsWithBlockedWidgets_data();
void disableShortcutsWithBlockedWidgets();
void shortcutFromKeyEvent(); // QTBUG-48325
+#endif
private:
QEvent::Type m_lastEventType;
@@ -221,6 +227,8 @@ void tst_QAction::actionEvent()
QCOMPARE(m_lastAction, &a);
}
+#if QT_CONFIG(shortcut)
+
//basic testing of standard keys
void tst_QAction::setStandardKeys()
{
@@ -367,6 +375,8 @@ void tst_QAction::task200823_tooltip()
QCOMPARE(action->toolTip(), ref);
}
+#endif // QT_CONFIG(shortcut)
+
void tst_QAction::task229128TriggeredSignalWithoutActiongroup()
{
// test without a group
@@ -408,6 +418,8 @@ void tst_QAction::task229128TriggeredSignalWhenInActiongroup()
QCOMPARE(actionSpy.count(), 1);
}
+#if QT_CONFIG(shortcut)
+
void tst_QAction::repeat()
{
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive))
@@ -452,6 +464,8 @@ void tst_QAction::repeat()
QCOMPARE(spy.count(), 2);
}
+#endif // QT_CONFIG(shortcut)
+
void tst_QAction::setData() // QTBUG-62006
{
QAction act(nullptr);
@@ -467,6 +481,8 @@ void tst_QAction::setData() // QTBUG-62006
QCOMPARE(spy.count(), 1);
}
+#if QT_CONFIG(shortcut)
+
void tst_QAction::disableShortcutsWithBlockedWidgets_data()
{
QTest::addColumn<Qt::ShortcutContext>("shortcutContext");
@@ -556,5 +572,7 @@ void tst_QAction::shortcutFromKeyEvent()
QCOMPARE(testWidget.shortcutOverrideCount, 1);
}
+#endif // QT_CONFIG(shortcut)
+
QTEST_MAIN(tst_QAction)
#include "tst_qaction.moc"