diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-03-18 17:02:11 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-03-29 11:18:57 +0100 |
commit | bcaff2b06fc46fce8a3ae6d613c025c8d097229c (patch) | |
tree | fde5485241a96c5ea1222e8299b046fdea9084e6 /tests | |
parent | e3d01840656a07f17549864da163b67094c03c0e (diff) |
Remove QGuiAction again and split QAction implementation up instead
Duplicating the number of classes is a high price to pay to be able to
have some QAction functionality behave differently, or be only available
in widgets applications.
Instead, declare the entire API in QtGui in QAction* classes, and
delegate the implementation of QtWidgets specific functionality to
the private. The creation of the private is then delegated to the
Q(Gui)ApplicationPrivate instance through a virtual factory function.
Change some public APIs that are primarily useful for specialized tools
such as Designer to operate on QObject* rather than QWidget*. APIs that
depend on QtWidgets types have been turned into inline template
functions, so that they are instantiated only at the caller side, where
we can expect the respective types to be fully defined. This way, we
only need to forward declare a few classes in the header, and don't
need to generate any additional code for e.g. language bindings.
Change-Id: Id0b27f9187652ec531a2e8b1b9837e82dc81625c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests')
22 files changed, 126 insertions, 100 deletions
diff --git a/tests/auto/gui/kernel/kernel.pro b/tests/auto/gui/kernel/kernel.pro index 106e9050b8..3619e31ded 100644 --- a/tests/auto/gui/kernel/kernel.pro +++ b/tests/auto/gui/kernel/kernel.pro @@ -1,11 +1,11 @@ TEMPLATE=subdirs SUBDIRS=\ + qaction \ + qactiongroup \ qbackingstore \ qclipboard \ qcursor \ qdrag \ - qguiaction \ - qguiactiongroup \ qevent \ qfileopenevent \ qguieventdispatcher \ @@ -46,8 +46,8 @@ win32:!winrt:qtHaveModule(network): SUBDIRS += noqteventloop qguieventloop !qtConfig(action): SUBDIRS -= \ - qguiaction \ - qguiactiongroup + qaction \ + qactiongroup !qtConfig(highdpiscaling): SUBDIRS -= qhighdpiscaling diff --git a/tests/auto/gui/kernel/qguiaction/.gitignore b/tests/auto/gui/kernel/qaction/.gitignore index bf81f5bf2c..bf81f5bf2c 100644 --- a/tests/auto/gui/kernel/qguiaction/.gitignore +++ b/tests/auto/gui/kernel/qaction/.gitignore diff --git a/tests/auto/gui/kernel/qaction/CMakeLists.txt b/tests/auto/gui/kernel/qaction/CMakeLists.txt new file mode 100644 index 0000000000..c14444c123 --- /dev/null +++ b/tests/auto/gui/kernel/qaction/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from qaction.pro. + +##################################################################### +## tst_qaction Test: +##################################################################### + +add_qt_test(tst_qaction + SOURCES + tst_qaction.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate +) diff --git a/tests/auto/gui/kernel/qguiaction/qguiaction.pro b/tests/auto/gui/kernel/qaction/qaction.pro index 2a39636119..fae8d826f4 100644 --- a/tests/auto/gui/kernel/qguiaction/qguiaction.pro +++ b/tests/auto/gui/kernel/qaction/qaction.pro @@ -1,4 +1,4 @@ CONFIG += testcase -TARGET = tst_qguiaction +TARGET = tst_qaction QT += gui-private core-private testlib -SOURCES += tst_qguiaction.cpp +SOURCES += tst_qaction.cpp diff --git a/tests/auto/gui/kernel/qguiaction/tst_qguiaction.cpp b/tests/auto/gui/kernel/qaction/tst_qaction.cpp index cc607c644f..a34c763021 100644 --- a/tests/auto/gui/kernel/qguiaction/tst_qguiaction.cpp +++ b/tests/auto/gui/kernel/qaction/tst_qaction.cpp @@ -30,18 +30,18 @@ #include <qguiapplication.h> #include <qevent.h> -#include <qguiaction.h> -#include <qguiactiongroup.h> +#include <qaction.h> +#include <qactiongroup.h> #include <qpa/qplatformtheme.h> #include <private/qguiapplication_p.h> -class tst_QGuiAction : public QObject +class tst_QAction : public QObject { Q_OBJECT public: - tst_QGuiAction(); + tst_QAction(); private slots: void cleanup(); @@ -63,35 +63,33 @@ private: const int m_keyboardScheme; }; -tst_QGuiAction::tst_QGuiAction() +tst_QAction::tst_QAction() : m_keyboardScheme(QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::KeyboardScheme).toInt()) { } -void tst_QGuiAction::cleanup() +void tst_QAction::cleanup() { QVERIFY(QGuiApplication::topLevelWindows().isEmpty()); } // Testing get/set functions -void tst_QGuiAction::getSetCheck() +void tst_QAction::getSetCheck() { - QGuiAction obj1(nullptr); - // QActionGroup * QAction::actionGroup() - // void QAction::setActionGroup(QActionGroup *) - auto var1 = new QGuiActionGroup(nullptr); + QAction obj1(nullptr); + auto var1 = new QActionGroup(nullptr); obj1.setActionGroup(var1); - QCOMPARE(var1, obj1.guiActionGroup()); + QCOMPARE(var1, obj1.actionGroup()); obj1.setActionGroup(nullptr); - QCOMPARE(obj1.guiActionGroup(), nullptr); + QCOMPARE(obj1.actionGroup(), nullptr); delete var1; - QCOMPARE(obj1.priority(), QGuiAction::NormalPriority); - obj1.setPriority(QGuiAction::LowPriority); - QCOMPARE(obj1.priority(), QGuiAction::LowPriority); + QCOMPARE(obj1.priority(), QAction::NormalPriority); + obj1.setPriority(QAction::LowPriority); + QCOMPARE(obj1.priority(), QAction::LowPriority); } -void tst_QGuiAction::setText_data() +void tst_QAction::setText_data() { QTest::addColumn<QString>("text"); QTest::addColumn<QString>("iconText"); @@ -103,11 +101,11 @@ void tst_QGuiAction::setText_data() QTest::newRow("Mnemonic and ellipsis") << "O&pen File ..." << "Open File" << "Open File"; } -void tst_QGuiAction::setText() +void tst_QAction::setText() { QFETCH(QString, text); - QGuiAction action(nullptr); + QAction action(nullptr); action.setText(text); QCOMPARE(action.text(), text); @@ -116,11 +114,11 @@ void tst_QGuiAction::setText() QCOMPARE(action.iconText(), iconText); } -void tst_QGuiAction::setIconText() +void tst_QAction::setIconText() { QFETCH(QString, iconText); - QGuiAction action(nullptr); + QAction action(nullptr); action.setIconText(iconText); QCOMPARE(action.iconText(), iconText); @@ -131,9 +129,9 @@ void tst_QGuiAction::setIconText() #if QT_CONFIG(shortcut) //basic testing of standard keys -void tst_QGuiAction::setStandardKeys() +void tst_QAction::setStandardKeys() { - QGuiAction act(nullptr); + QAction act(nullptr); act.setShortcut(QKeySequence("CTRL+L")); QList<QKeySequence> list; act.setShortcuts(list); @@ -158,9 +156,9 @@ void tst_QGuiAction::setStandardKeys() QCOMPARE(act.shortcuts(), expected); } -void tst_QGuiAction::task200823_tooltip() +void tst_QAction::task200823_tooltip() { - const QScopedPointer<QGuiAction> action(new QGuiAction("foo", nullptr)); + const QScopedPointer<QAction> action(new QAction("foo", nullptr)); QString shortcut("ctrl+o"); action->setShortcut(shortcut); @@ -173,11 +171,11 @@ void tst_QGuiAction::task200823_tooltip() #endif // QT_CONFIG(shortcut) -void tst_QGuiAction::task229128TriggeredSignalWithoutActiongroup() +void tst_QAction::task229128TriggeredSignalWithoutActiongroup() { // test without a group - const QScopedPointer<QGuiAction> actionWithoutGroup(new QGuiAction("Test", nullptr)); - QSignalSpy spyWithoutGroup(actionWithoutGroup.data(), QOverload<bool>::of(&QGuiAction::triggered)); + 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 @@ -193,10 +191,10 @@ void tst_QGuiAction::task229128TriggeredSignalWithoutActiongroup() QCOMPARE(spyWithoutGroup.count(), 1); } -void tst_QGuiAction::setData() // QTBUG-62006 +void tst_QAction::setData() // QTBUG-62006 { - QGuiAction act(nullptr); - QSignalSpy spy(&act, &QGuiAction::changed); + QAction act(nullptr); + QSignalSpy spy(&act, &QAction::changed); QCOMPARE(act.data(), QVariant()); QCOMPARE(spy.count(), 0); act.setData(QVariant()); @@ -208,10 +206,10 @@ void tst_QGuiAction::setData() // QTBUG-62006 QCOMPARE(spy.count(), 1); } -void tst_QGuiAction::setEnabledSetVisible() +void tst_QAction::setEnabledSetVisible() { - QGuiAction action(nullptr); - QSignalSpy spy(&action, &QGuiAction::enabledChanged); + QAction action(nullptr); + QSignalSpy spy(&action, &QAction::enabledChanged); QVERIFY(action.isEnabled()); QVERIFY(action.isVisible()); QCOMPARE(spy.count(), 0); @@ -232,12 +230,12 @@ void tst_QGuiAction::setEnabledSetVisible() QCOMPARE(spy.count(), 2); } -void tst_QGuiAction::setCheckabledSetChecked() +void tst_QAction::setCheckabledSetChecked() { - QGuiAction action(nullptr); - QSignalSpy changedSpy(&action, &QGuiAction::changed); - QSignalSpy checkedSpy(&action, &QGuiAction::toggled); - QSignalSpy checkableSpy(&action, &QGuiAction::checkableChanged); + QAction action(nullptr); + QSignalSpy changedSpy(&action, &QAction::changed); + QSignalSpy checkedSpy(&action, &QAction::toggled); + QSignalSpy checkableSpy(&action, &QAction::checkableChanged); QVERIFY(!action.isCheckable()); QVERIFY(!action.isChecked()); QCOMPARE(changedSpy.count(), 0); @@ -273,5 +271,5 @@ void tst_QGuiAction::setCheckabledSetChecked() QCOMPARE(checkableSpy.count(), 3); } -QTEST_MAIN(tst_QGuiAction) -#include "tst_qguiaction.moc" +QTEST_MAIN(tst_QAction) +#include "tst_qaction.moc" diff --git a/tests/auto/gui/kernel/qguiactiongroup/.gitignore b/tests/auto/gui/kernel/qactiongroup/.gitignore index daba003e96..daba003e96 100644 --- a/tests/auto/gui/kernel/qguiactiongroup/.gitignore +++ b/tests/auto/gui/kernel/qactiongroup/.gitignore diff --git a/tests/auto/gui/kernel/qactiongroup/CMakeLists.txt b/tests/auto/gui/kernel/qactiongroup/CMakeLists.txt new file mode 100644 index 0000000000..6ef659ebc1 --- /dev/null +++ b/tests/auto/gui/kernel/qactiongroup/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qactiongroup.pro. + +##################################################################### +## tst_qactiongroup Test: +##################################################################### + +add_qt_test(tst_qactiongroup + SOURCES + tst_qactiongroup.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/gui/kernel/qguiactiongroup/qguiactiongroup.pro b/tests/auto/gui/kernel/qactiongroup/qactiongroup.pro index 7fd64e70f1..81ceb10429 100644 --- a/tests/auto/gui/kernel/qguiactiongroup/qguiactiongroup.pro +++ b/tests/auto/gui/kernel/qactiongroup/qactiongroup.pro @@ -1,4 +1,4 @@ CONFIG += testcase TARGET = tst_qactiongroup QT += testlib -SOURCES += tst_qguiactiongroup.cpp +SOURCES += tst_qactiongroup.cpp diff --git a/tests/auto/gui/kernel/qguiactiongroup/tst_qguiactiongroup.cpp b/tests/auto/gui/kernel/qactiongroup/tst_qactiongroup.cpp index 1ac14280fb..c5a3db7b62 100644 --- a/tests/auto/gui/kernel/qguiactiongroup/tst_qguiactiongroup.cpp +++ b/tests/auto/gui/kernel/qactiongroup/tst_qactiongroup.cpp @@ -28,10 +28,10 @@ #include <QtTest/QtTest> -#include <qguiaction.h> -#include <qguiactiongroup.h> +#include <qaction.h> +#include <qactiongroup.h> -class tst_QGuiActionGroup : public QObject +class tst_QActionGroup : public QObject { Q_OBJECT @@ -45,13 +45,13 @@ private slots: void unCheckCurrentAction(); }; -void tst_QGuiActionGroup::enabledPropagation() +void tst_QActionGroup::enabledPropagation() { - QGuiActionGroup testActionGroup(nullptr); + QActionGroup testActionGroup(nullptr); - auto childAction = new QGuiAction( &testActionGroup ); - auto anotherChildAction = new QGuiAction( &testActionGroup ); - auto freeAction = new QGuiAction(nullptr); + auto childAction = new QAction( &testActionGroup ); + auto anotherChildAction = new QAction( &testActionGroup ); + auto freeAction = new QAction(nullptr); QVERIFY( testActionGroup.isEnabled() ); QVERIFY( childAction->isEnabled() ); @@ -72,7 +72,7 @@ void tst_QGuiActionGroup::enabledPropagation() QVERIFY( !anotherChildAction->isEnabled() ); testActionGroup.setEnabled( false ); - auto lastChildAction = new QGuiAction(&testActionGroup); + auto lastChildAction = new QAction(&testActionGroup); QVERIFY(!lastChildAction->isEnabled()); testActionGroup.setEnabled( true ); @@ -84,13 +84,13 @@ void tst_QGuiActionGroup::enabledPropagation() delete freeAction; } -void tst_QGuiActionGroup::visiblePropagation() +void tst_QActionGroup::visiblePropagation() { - QGuiActionGroup testActionGroup(nullptr); + QActionGroup testActionGroup(nullptr); - auto childAction = new QGuiAction( &testActionGroup ); - auto anotherChildAction = new QGuiAction( &testActionGroup ); - auto freeAction = new QGuiAction(nullptr); + auto childAction = new QAction( &testActionGroup ); + auto anotherChildAction = new QAction( &testActionGroup ); + auto freeAction = new QAction(nullptr); QVERIFY( testActionGroup.isVisible() ); QVERIFY( childAction->isVisible() ); @@ -109,7 +109,7 @@ void tst_QGuiActionGroup::visiblePropagation() QVERIFY( !anotherChildAction->isVisible() ); testActionGroup.setVisible( false ); - auto lastChildAction = new QGuiAction(&testActionGroup); + auto lastChildAction = new QAction(&testActionGroup); QVERIFY(!lastChildAction->isVisible()); testActionGroup.setVisible( true ); @@ -121,17 +121,17 @@ void tst_QGuiActionGroup::visiblePropagation() delete freeAction; } -void tst_QGuiActionGroup::exclusive() +void tst_QActionGroup::exclusive() { - QGuiActionGroup group(nullptr); + QActionGroup group(nullptr); group.setExclusive(false); QVERIFY( !group.isExclusive() ); - auto actOne = new QGuiAction(&group); + auto actOne = new QAction(&group); actOne->setCheckable( true ); - auto actTwo = new QGuiAction(&group); + auto actTwo = new QAction(&group); actTwo->setCheckable( true ); - auto actThree = new QGuiAction(&group); + auto actThree = new QAction(&group); actThree->setCheckable( true ); group.setExclusive( true ); @@ -150,17 +150,17 @@ void tst_QGuiActionGroup::exclusive() QVERIFY( !actThree->isChecked() ); } -void tst_QGuiActionGroup::exclusiveOptional() +void tst_QActionGroup::exclusiveOptional() { - QGuiActionGroup group(0); + QActionGroup group(0); group.setExclusive(true); QVERIFY( group.isExclusive() ); - auto actOne = new QGuiAction(&group); + auto actOne = new QAction(&group); actOne->setCheckable( true ); - auto actTwo = new QGuiAction(&group); + auto actTwo = new QAction(&group); actTwo->setCheckable( true ); - auto actThree = new QGuiAction(&group); + auto actThree = new QAction(&group); actThree->setCheckable( true ); QVERIFY( !actOne->isChecked() ); @@ -177,7 +177,7 @@ void tst_QGuiActionGroup::exclusiveOptional() QVERIFY( !actTwo->isChecked() ); QVERIFY( !actThree->isChecked() ); - group.setExclusionPolicy(QGuiActionGroup::ExclusionPolicy::ExclusiveOptional); + group.setExclusionPolicy(QActionGroup::ExclusionPolicy::ExclusiveOptional); QVERIFY( group.isExclusive() ); actOne->trigger(); @@ -196,25 +196,25 @@ void tst_QGuiActionGroup::exclusiveOptional() QVERIFY( !actThree->isChecked() ); } -void tst_QGuiActionGroup::testActionInTwoQActionGroup() +void tst_QActionGroup::testActionInTwoQActionGroup() { - QGuiAction action1("Action 1", this); + QAction action1("Action 1", this); - QGuiActionGroup group1(this); - QGuiActionGroup group2(this); + QActionGroup group1(this); + QActionGroup group2(this); group1.addAction(&action1); group2.addAction(&action1); - QCOMPARE(action1.guiActionGroup(), &group2); - QCOMPARE(group2.guiActions().constFirst(), &action1); - QCOMPARE(group1.guiActions().isEmpty(), true); + QCOMPARE(action1.actionGroup(), &group2); + QCOMPARE(group2.actions().constFirst(), &action1); + QCOMPARE(group1.actions().isEmpty(), true); } -void tst_QGuiActionGroup::unCheckCurrentAction() +void tst_QActionGroup::unCheckCurrentAction() { - QGuiActionGroup group(nullptr); - QGuiAction action1(&group) ,action2(&group); + QActionGroup group(nullptr); + QAction action1(&group) ,action2(&group); action1.setCheckable(true); action2.setCheckable(true); QVERIFY(!action1.isChecked()); @@ -222,14 +222,14 @@ void tst_QGuiActionGroup::unCheckCurrentAction() action1.setChecked(true); QVERIFY(action1.isChecked()); QVERIFY(!action2.isChecked()); - auto current = group.checkedGuiAction(); + auto current = group.checkedAction(); QCOMPARE(current, &action1); current->setChecked(false); QVERIFY(!action1.isChecked()); QVERIFY(!action2.isChecked()); - QVERIFY(!group.checkedGuiAction()); + QVERIFY(!group.checkedAction()); } -QTEST_MAIN(tst_QGuiActionGroup) -#include "tst_qguiactiongroup.moc" +QTEST_MAIN(tst_QActionGroup) +#include "tst_qactiongroup.moc" diff --git a/tests/auto/tools/uic/baseline/browserwidget.ui.h b/tests/auto/tools/uic/baseline/browserwidget.ui.h index 7dcfb290f7..07142c5ea1 100644 --- a/tests/auto/tools/uic/baseline/browserwidget.ui.h +++ b/tests/auto/tools/uic/baseline/browserwidget.ui.h @@ -10,7 +10,7 @@ #define BROWSERWIDGET_H #include <QtCore/QVariant> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QGroupBox> #include <QtWidgets/QHBoxLayout> diff --git a/tests/auto/tools/uic/baseline/chatmainwindow.ui.h b/tests/auto/tools/uic/baseline/chatmainwindow.ui.h index 220d44300b..43f83059d4 100644 --- a/tests/auto/tools/uic/baseline/chatmainwindow.ui.h +++ b/tests/auto/tools/uic/baseline/chatmainwindow.ui.h @@ -10,7 +10,7 @@ #define CHATMAINWINDOW_H #include <QtCore/QVariant> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QLabel> diff --git a/tests/auto/tools/uic/baseline/default.ui.h b/tests/auto/tools/uic/baseline/default.ui.h index fbbe81d0b8..bc9ad75858 100644 --- a/tests/auto/tools/uic/baseline/default.ui.h +++ b/tests/auto/tools/uic/baseline/default.ui.h @@ -10,7 +10,7 @@ #define DEFAULT_H #include <QtCore/QVariant> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QCheckBox> #include <QtWidgets/QComboBox> diff --git a/tests/auto/tools/uic/baseline/mainwindow.ui.h b/tests/auto/tools/uic/baseline/mainwindow.ui.h index df61d57ceb..1f375dd313 100644 --- a/tests/auto/tools/uic/baseline/mainwindow.ui.h +++ b/tests/auto/tools/uic/baseline/mainwindow.ui.h @@ -10,7 +10,7 @@ #define MAINWINDOW_H #include <QtCore/QVariant> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QCheckBox> #include <QtWidgets/QComboBox> diff --git a/tests/auto/tools/uic/baseline/pagefold.ui.h b/tests/auto/tools/uic/baseline/pagefold.ui.h index a0594b7ec7..cc5f96982b 100644 --- a/tests/auto/tools/uic/baseline/pagefold.ui.h +++ b/tests/auto/tools/uic/baseline/pagefold.ui.h @@ -10,7 +10,7 @@ #define PAGEFOLD_H #include <QtCore/QVariant> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QCheckBox> #include <QtWidgets/QComboBox> diff --git a/tests/auto/tools/uic/baseline/qttrid.ui.h b/tests/auto/tools/uic/baseline/qttrid.ui.h index 890ffc7789..cb5a4cb2e8 100644 --- a/tests/auto/tools/uic/baseline/qttrid.ui.h +++ b/tests/auto/tools/uic/baseline/qttrid.ui.h @@ -10,8 +10,8 @@ #define QTTRID_H #include <QtCore/QVariant> +#include <QtGui/QAction> #include <QtGui/QIcon> -#include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QCheckBox> #include <QtWidgets/QGridLayout> diff --git a/tests/auto/tools/uic/baseline/remotecontrol.ui.h b/tests/auto/tools/uic/baseline/remotecontrol.ui.h index 5b7c6c42c2..c5b72be860 100644 --- a/tests/auto/tools/uic/baseline/remotecontrol.ui.h +++ b/tests/auto/tools/uic/baseline/remotecontrol.ui.h @@ -10,8 +10,8 @@ #define REMOTECONTROL_H #include <QtCore/QVariant> +#include <QtGui/QAction> #include <QtGui/QIcon> -#include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QCheckBox> #include <QtWidgets/QGridLayout> diff --git a/tests/auto/tools/uic/baseline/trpreviewtool.ui.h b/tests/auto/tools/uic/baseline/trpreviewtool.ui.h index 612d7ad427..3e1e7afbd3 100644 --- a/tests/auto/tools/uic/baseline/trpreviewtool.ui.h +++ b/tests/auto/tools/uic/baseline/trpreviewtool.ui.h @@ -40,7 +40,7 @@ #define TRPREVIEWTOOL_H #include <QtCore/QVariant> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QDockWidget> #include <QtWidgets/QListView> diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp index cf8539da68..b4c259a1ef 100644 --- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp +++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp @@ -33,6 +33,7 @@ #include <qapplication.h> #include <qevent.h> #include <qaction.h> +#include <qactiongroup.h> #include <qmenu.h> #include <qpa/qplatformtheme.h> #include <qpa/qplatformintegration.h> @@ -68,7 +69,7 @@ private slots: private: QEvent::Type m_lastEventType; const int m_keyboardScheme; - QGuiAction *m_lastAction; + QAction *m_lastAction; }; tst_QAction::tst_QAction() diff --git a/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp b/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp index d3b07ba26a..539ff9c67f 100644 --- a/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp +++ b/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp @@ -31,6 +31,7 @@ #include <qmainwindow.h> #include <qmenu.h> #include <qaction.h> +#include <qactiongroup.h> class tst_QActionGroup : public QObject { diff --git a/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp b/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp index 6a2c8893d2..58a90dd572 100644 --- a/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp +++ b/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp @@ -30,7 +30,7 @@ #include <QtWidgets/QStyle> #include <QtWidgets/QLayout> #include <QtWidgets/QDialog> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <qdialogbuttonbox.h> #include <limits.h> diff --git a/tests/manual/cocoa/menurama/main.cpp b/tests/manual/cocoa/menurama/main.cpp index e39c01ea4d..4da4511884 100644 --- a/tests/manual/cocoa/menurama/main.cpp +++ b/tests/manual/cocoa/menurama/main.cpp @@ -29,7 +29,7 @@ #include "mainwindow.h" #include "menuramaapplication.h" -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QMenu> int main(int argc, char *argv[]) diff --git a/tests/manual/foreignwindows/main.cpp b/tests/manual/foreignwindows/main.cpp index 5e882b6d9c..843f4e39ef 100644 --- a/tests/manual/foreignwindows/main.cpp +++ b/tests/manual/foreignwindows/main.cpp @@ -26,7 +26,7 @@ ** ****************************************************************************/ -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QDesktopWidget> #include <QtWidgets/QMainWindow> |