From bcaff2b06fc46fce8a3ae6d613c025c8d097229c Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 18 Mar 2020 17:02:11 +0100 Subject: 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 --- tests/auto/gui/kernel/kernel.pro | 8 +- tests/auto/gui/kernel/qaction/.gitignore | 1 + tests/auto/gui/kernel/qaction/CMakeLists.txt | 14 ++ tests/auto/gui/kernel/qaction/qaction.pro | 4 + tests/auto/gui/kernel/qaction/tst_qaction.cpp | 275 ++++++++++++++++++++ tests/auto/gui/kernel/qactiongroup/.gitignore | 1 + tests/auto/gui/kernel/qactiongroup/CMakeLists.txt | 12 + .../auto/gui/kernel/qactiongroup/qactiongroup.pro | 4 + .../gui/kernel/qactiongroup/tst_qactiongroup.cpp | 235 +++++++++++++++++ tests/auto/gui/kernel/qguiaction/.gitignore | 1 - tests/auto/gui/kernel/qguiaction/qguiaction.pro | 4 - .../auto/gui/kernel/qguiaction/tst_qguiaction.cpp | 277 --------------------- tests/auto/gui/kernel/qguiactiongroup/.gitignore | 1 - .../gui/kernel/qguiactiongroup/qguiactiongroup.pro | 4 - .../kernel/qguiactiongroup/tst_qguiactiongroup.cpp | 235 ----------------- tests/auto/tools/uic/baseline/browserwidget.ui.h | 2 +- tests/auto/tools/uic/baseline/chatmainwindow.ui.h | 2 +- tests/auto/tools/uic/baseline/default.ui.h | 2 +- tests/auto/tools/uic/baseline/mainwindow.ui.h | 2 +- tests/auto/tools/uic/baseline/pagefold.ui.h | 2 +- tests/auto/tools/uic/baseline/qttrid.ui.h | 2 +- tests/auto/tools/uic/baseline/remotecontrol.ui.h | 2 +- tests/auto/tools/uic/baseline/trpreviewtool.ui.h | 2 +- tests/auto/widgets/kernel/qaction/tst_qaction.cpp | 3 +- .../kernel/qactiongroup/tst_qactiongroup.cpp | 1 + .../qdialogbuttonbox/tst_qdialogbuttonbox.cpp | 2 +- tests/manual/cocoa/menurama/main.cpp | 2 +- tests/manual/foreignwindows/main.cpp | 2 +- 28 files changed, 564 insertions(+), 538 deletions(-) create mode 100644 tests/auto/gui/kernel/qaction/.gitignore create mode 100644 tests/auto/gui/kernel/qaction/CMakeLists.txt create mode 100644 tests/auto/gui/kernel/qaction/qaction.pro create mode 100644 tests/auto/gui/kernel/qaction/tst_qaction.cpp create mode 100644 tests/auto/gui/kernel/qactiongroup/.gitignore create mode 100644 tests/auto/gui/kernel/qactiongroup/CMakeLists.txt create mode 100644 tests/auto/gui/kernel/qactiongroup/qactiongroup.pro create mode 100644 tests/auto/gui/kernel/qactiongroup/tst_qactiongroup.cpp delete mode 100644 tests/auto/gui/kernel/qguiaction/.gitignore delete mode 100644 tests/auto/gui/kernel/qguiaction/qguiaction.pro delete mode 100644 tests/auto/gui/kernel/qguiaction/tst_qguiaction.cpp delete mode 100644 tests/auto/gui/kernel/qguiactiongroup/.gitignore delete mode 100644 tests/auto/gui/kernel/qguiactiongroup/qguiactiongroup.pro delete mode 100644 tests/auto/gui/kernel/qguiactiongroup/tst_qguiactiongroup.cpp (limited to 'tests') 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/qaction/.gitignore b/tests/auto/gui/kernel/qaction/.gitignore new file mode 100644 index 0000000000..bf81f5bf2c --- /dev/null +++ b/tests/auto/gui/kernel/qaction/.gitignore @@ -0,0 +1 @@ +tst_qaction 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/qaction/qaction.pro b/tests/auto/gui/kernel/qaction/qaction.pro new file mode 100644 index 0000000000..fae8d826f4 --- /dev/null +++ b/tests/auto/gui/kernel/qaction/qaction.pro @@ -0,0 +1,4 @@ +CONFIG += testcase +TARGET = tst_qaction +QT += gui-private core-private testlib +SOURCES += tst_qaction.cpp diff --git a/tests/auto/gui/kernel/qaction/tst_qaction.cpp b/tests/auto/gui/kernel/qaction/tst_qaction.cpp new file mode 100644 index 0000000000..a34c763021 --- /dev/null +++ b/tests/auto/gui/kernel/qaction/tst_qaction.cpp @@ -0,0 +1,275 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include + +class tst_QAction : public QObject +{ + Q_OBJECT + +public: + tst_QAction(); + +private slots: + void cleanup(); + void getSetCheck(); + void setText_data(); + void setText(); + void setIconText_data() { setText_data(); } + void setIconText(); +#if QT_CONFIG(shortcut) + void setStandardKeys(); + void task200823_tooltip(); +#endif + void task229128TriggeredSignalWithoutActiongroup(); + void setData(); + void setEnabledSetVisible(); + void setCheckabledSetChecked(); + +private: + const int m_keyboardScheme; +}; + +tst_QAction::tst_QAction() + : m_keyboardScheme(QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::KeyboardScheme).toInt()) +{ +} + +void tst_QAction::cleanup() +{ + QVERIFY(QGuiApplication::topLevelWindows().isEmpty()); +} + +// Testing get/set functions +void tst_QAction::getSetCheck() +{ + QAction obj1(nullptr); + auto var1 = new QActionGroup(nullptr); + obj1.setActionGroup(var1); + QCOMPARE(var1, obj1.actionGroup()); + obj1.setActionGroup(nullptr); + QCOMPARE(obj1.actionGroup(), nullptr); + delete var1; + + QCOMPARE(obj1.priority(), QAction::NormalPriority); + obj1.setPriority(QAction::LowPriority); + QCOMPARE(obj1.priority(), QAction::LowPriority); +} + +void tst_QAction::setText_data() +{ + QTest::addColumn("text"); + QTest::addColumn("iconText"); + QTest::addColumn("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); +} + +#if QT_CONFIG(shortcut) + +//basic testing of standard keys +void tst_QAction::setStandardKeys() +{ + QAction act(nullptr); + act.setShortcut(QKeySequence("CTRL+L")); + QList list; + act.setShortcuts(list); + act.setShortcuts(QKeySequence::Copy); + QCOMPARE(act.shortcut(), act.shortcuts().constFirst()); + + QList 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); +} + +void tst_QAction::task200823_tooltip() +{ + const QScopedPointer 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); +} + +#endif // QT_CONFIG(shortcut) + +void tst_QAction::task229128TriggeredSignalWithoutActiongroup() +{ + // test without a group + const QScopedPointer actionWithoutGroup(new QAction("Test", nullptr)); + QSignalSpy spyWithoutGroup(actionWithoutGroup.data(), QOverload::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); +} + +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::setEnabledSetVisible() +{ + QAction action(nullptr); + QSignalSpy spy(&action, &QAction::enabledChanged); + QVERIFY(action.isEnabled()); + QVERIFY(action.isVisible()); + QCOMPARE(spy.count(), 0); + action.setVisible(false); + QVERIFY(!action.isEnabled()); + QVERIFY(!action.isVisible()); + QCOMPARE(spy.count(), 1); + action.setEnabled(false); + QVERIFY(!action.isEnabled()); + QVERIFY(!action.isVisible()); + QCOMPARE(spy.count(), 1); + action.setVisible(true); + QVERIFY(!action.isEnabled()); + QVERIFY(action.isVisible()); + QCOMPARE(spy.count(), 1); + action.resetEnabled(); + QVERIFY(action.isEnabled()); + QCOMPARE(spy.count(), 2); +} + +void tst_QAction::setCheckabledSetChecked() +{ + 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); + QCOMPARE(checkedSpy.count(), 0); + QCOMPARE(checkableSpy.count(), 0); + + action.setCheckable(true); + QVERIFY(action.isCheckable()); + QVERIFY(!action.isChecked()); + QCOMPARE(changedSpy.count(), 1); + QCOMPARE(checkedSpy.count(), 0); + QCOMPARE(checkableSpy.count(), 1); + + action.setChecked(true); + QVERIFY(action.isCheckable()); + QVERIFY(action.isChecked()); + QCOMPARE(changedSpy.count(), 2); + QCOMPARE(checkedSpy.count(), 1); + QCOMPARE(checkableSpy.count(), 1); + + action.setCheckable(false); + QVERIFY(!action.isCheckable()); + QVERIFY(!action.isChecked()); + QCOMPARE(changedSpy.count(), 3); + QCOMPARE(checkedSpy.count(), 2); + QCOMPARE(checkableSpy.count(), 2); + + action.setCheckable(true); + QVERIFY(action.isCheckable()); + QVERIFY(action.isChecked()); + QCOMPARE(changedSpy.count(), 4); + QCOMPARE(checkedSpy.count(), 3); + QCOMPARE(checkableSpy.count(), 3); +} + +QTEST_MAIN(tst_QAction) +#include "tst_qaction.moc" diff --git a/tests/auto/gui/kernel/qactiongroup/.gitignore b/tests/auto/gui/kernel/qactiongroup/.gitignore new file mode 100644 index 0000000000..daba003e96 --- /dev/null +++ b/tests/auto/gui/kernel/qactiongroup/.gitignore @@ -0,0 +1 @@ +tst_qactiongroup 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/qactiongroup/qactiongroup.pro b/tests/auto/gui/kernel/qactiongroup/qactiongroup.pro new file mode 100644 index 0000000000..81ceb10429 --- /dev/null +++ b/tests/auto/gui/kernel/qactiongroup/qactiongroup.pro @@ -0,0 +1,4 @@ +CONFIG += testcase +TARGET = tst_qactiongroup +QT += testlib +SOURCES += tst_qactiongroup.cpp diff --git a/tests/auto/gui/kernel/qactiongroup/tst_qactiongroup.cpp b/tests/auto/gui/kernel/qactiongroup/tst_qactiongroup.cpp new file mode 100644 index 0000000000..c5a3db7b62 --- /dev/null +++ b/tests/auto/gui/kernel/qactiongroup/tst_qactiongroup.cpp @@ -0,0 +1,235 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include +#include + +class tst_QActionGroup : public QObject +{ + Q_OBJECT + +private slots: + void cleanup() { QVERIFY(QGuiApplication::topLevelWindows().isEmpty()); } + void enabledPropagation(); + void visiblePropagation(); + void exclusive(); + void exclusiveOptional(); + void testActionInTwoQActionGroup(); + void unCheckCurrentAction(); +}; + +void tst_QActionGroup::enabledPropagation() +{ + QActionGroup testActionGroup(nullptr); + + auto childAction = new QAction( &testActionGroup ); + auto anotherChildAction = new QAction( &testActionGroup ); + auto 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 ); + auto 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); + + auto childAction = new QAction( &testActionGroup ); + auto anotherChildAction = new QAction( &testActionGroup ); + auto 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 ); + auto 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() ); + + auto actOne = new QAction(&group); + actOne->setCheckable( true ); + auto actTwo = new QAction(&group); + actTwo->setCheckable( true ); + auto 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() ); + + auto actOne = new QAction(&group); + actOne->setCheckable( true ); + auto actTwo = new QAction(&group); + actTwo->setCheckable( true ); + auto 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::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().constFirst(), &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()); + auto 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/gui/kernel/qguiaction/.gitignore b/tests/auto/gui/kernel/qguiaction/.gitignore deleted file mode 100644 index bf81f5bf2c..0000000000 --- a/tests/auto/gui/kernel/qguiaction/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tst_qaction diff --git a/tests/auto/gui/kernel/qguiaction/qguiaction.pro b/tests/auto/gui/kernel/qguiaction/qguiaction.pro deleted file mode 100644 index 2a39636119..0000000000 --- a/tests/auto/gui/kernel/qguiaction/qguiaction.pro +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG += testcase -TARGET = tst_qguiaction -QT += gui-private core-private testlib -SOURCES += tst_qguiaction.cpp diff --git a/tests/auto/gui/kernel/qguiaction/tst_qguiaction.cpp b/tests/auto/gui/kernel/qguiaction/tst_qguiaction.cpp deleted file mode 100644 index cc607c644f..0000000000 --- a/tests/auto/gui/kernel/qguiaction/tst_qguiaction.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include -#include -#include -#include -#include - -#include - -class tst_QGuiAction : public QObject -{ - Q_OBJECT - -public: - tst_QGuiAction(); - -private slots: - void cleanup(); - void getSetCheck(); - void setText_data(); - void setText(); - void setIconText_data() { setText_data(); } - void setIconText(); -#if QT_CONFIG(shortcut) - void setStandardKeys(); - void task200823_tooltip(); -#endif - void task229128TriggeredSignalWithoutActiongroup(); - void setData(); - void setEnabledSetVisible(); - void setCheckabledSetChecked(); - -private: - const int m_keyboardScheme; -}; - -tst_QGuiAction::tst_QGuiAction() - : m_keyboardScheme(QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::KeyboardScheme).toInt()) -{ -} - -void tst_QGuiAction::cleanup() -{ - QVERIFY(QGuiApplication::topLevelWindows().isEmpty()); -} - -// Testing get/set functions -void tst_QGuiAction::getSetCheck() -{ - QGuiAction obj1(nullptr); - // QActionGroup * QAction::actionGroup() - // void QAction::setActionGroup(QActionGroup *) - auto var1 = new QGuiActionGroup(nullptr); - obj1.setActionGroup(var1); - QCOMPARE(var1, obj1.guiActionGroup()); - obj1.setActionGroup(nullptr); - QCOMPARE(obj1.guiActionGroup(), nullptr); - delete var1; - - QCOMPARE(obj1.priority(), QGuiAction::NormalPriority); - obj1.setPriority(QGuiAction::LowPriority); - QCOMPARE(obj1.priority(), QGuiAction::LowPriority); -} - -void tst_QGuiAction::setText_data() -{ - QTest::addColumn("text"); - QTest::addColumn("iconText"); - QTest::addColumn("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_QGuiAction::setText() -{ - QFETCH(QString, text); - - QGuiAction action(nullptr); - action.setText(text); - - QCOMPARE(action.text(), text); - - QFETCH(QString, iconText); - QCOMPARE(action.iconText(), iconText); -} - -void tst_QGuiAction::setIconText() -{ - QFETCH(QString, iconText); - - QGuiAction action(nullptr); - action.setIconText(iconText); - QCOMPARE(action.iconText(), iconText); - - QFETCH(QString, textFromIconText); - QCOMPARE(action.text(), textFromIconText); -} - -#if QT_CONFIG(shortcut) - -//basic testing of standard keys -void tst_QGuiAction::setStandardKeys() -{ - QGuiAction act(nullptr); - act.setShortcut(QKeySequence("CTRL+L")); - QList list; - act.setShortcuts(list); - act.setShortcuts(QKeySequence::Copy); - QCOMPARE(act.shortcut(), act.shortcuts().constFirst()); - - QList 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); -} - -void tst_QGuiAction::task200823_tooltip() -{ - const QScopedPointer action(new QGuiAction("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); -} - -#endif // QT_CONFIG(shortcut) - -void tst_QGuiAction::task229128TriggeredSignalWithoutActiongroup() -{ - // test without a group - const QScopedPointer actionWithoutGroup(new QGuiAction("Test", nullptr)); - QSignalSpy spyWithoutGroup(actionWithoutGroup.data(), QOverload::of(&QGuiAction::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); -} - -void tst_QGuiAction::setData() // QTBUG-62006 -{ - QGuiAction act(nullptr); - QSignalSpy spy(&act, &QGuiAction::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_QGuiAction::setEnabledSetVisible() -{ - QGuiAction action(nullptr); - QSignalSpy spy(&action, &QGuiAction::enabledChanged); - QVERIFY(action.isEnabled()); - QVERIFY(action.isVisible()); - QCOMPARE(spy.count(), 0); - action.setVisible(false); - QVERIFY(!action.isEnabled()); - QVERIFY(!action.isVisible()); - QCOMPARE(spy.count(), 1); - action.setEnabled(false); - QVERIFY(!action.isEnabled()); - QVERIFY(!action.isVisible()); - QCOMPARE(spy.count(), 1); - action.setVisible(true); - QVERIFY(!action.isEnabled()); - QVERIFY(action.isVisible()); - QCOMPARE(spy.count(), 1); - action.resetEnabled(); - QVERIFY(action.isEnabled()); - QCOMPARE(spy.count(), 2); -} - -void tst_QGuiAction::setCheckabledSetChecked() -{ - QGuiAction action(nullptr); - QSignalSpy changedSpy(&action, &QGuiAction::changed); - QSignalSpy checkedSpy(&action, &QGuiAction::toggled); - QSignalSpy checkableSpy(&action, &QGuiAction::checkableChanged); - QVERIFY(!action.isCheckable()); - QVERIFY(!action.isChecked()); - QCOMPARE(changedSpy.count(), 0); - QCOMPARE(checkedSpy.count(), 0); - QCOMPARE(checkableSpy.count(), 0); - - action.setCheckable(true); - QVERIFY(action.isCheckable()); - QVERIFY(!action.isChecked()); - QCOMPARE(changedSpy.count(), 1); - QCOMPARE(checkedSpy.count(), 0); - QCOMPARE(checkableSpy.count(), 1); - - action.setChecked(true); - QVERIFY(action.isCheckable()); - QVERIFY(action.isChecked()); - QCOMPARE(changedSpy.count(), 2); - QCOMPARE(checkedSpy.count(), 1); - QCOMPARE(checkableSpy.count(), 1); - - action.setCheckable(false); - QVERIFY(!action.isCheckable()); - QVERIFY(!action.isChecked()); - QCOMPARE(changedSpy.count(), 3); - QCOMPARE(checkedSpy.count(), 2); - QCOMPARE(checkableSpy.count(), 2); - - action.setCheckable(true); - QVERIFY(action.isCheckable()); - QVERIFY(action.isChecked()); - QCOMPARE(changedSpy.count(), 4); - QCOMPARE(checkedSpy.count(), 3); - QCOMPARE(checkableSpy.count(), 3); -} - -QTEST_MAIN(tst_QGuiAction) -#include "tst_qguiaction.moc" diff --git a/tests/auto/gui/kernel/qguiactiongroup/.gitignore b/tests/auto/gui/kernel/qguiactiongroup/.gitignore deleted file mode 100644 index daba003e96..0000000000 --- a/tests/auto/gui/kernel/qguiactiongroup/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tst_qactiongroup diff --git a/tests/auto/gui/kernel/qguiactiongroup/qguiactiongroup.pro b/tests/auto/gui/kernel/qguiactiongroup/qguiactiongroup.pro deleted file mode 100644 index 7fd64e70f1..0000000000 --- a/tests/auto/gui/kernel/qguiactiongroup/qguiactiongroup.pro +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG += testcase -TARGET = tst_qactiongroup -QT += testlib -SOURCES += tst_qguiactiongroup.cpp diff --git a/tests/auto/gui/kernel/qguiactiongroup/tst_qguiactiongroup.cpp b/tests/auto/gui/kernel/qguiactiongroup/tst_qguiactiongroup.cpp deleted file mode 100644 index 1ac14280fb..0000000000 --- a/tests/auto/gui/kernel/qguiactiongroup/tst_qguiactiongroup.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include -#include - -class tst_QGuiActionGroup : public QObject -{ - Q_OBJECT - -private slots: - void cleanup() { QVERIFY(QGuiApplication::topLevelWindows().isEmpty()); } - void enabledPropagation(); - void visiblePropagation(); - void exclusive(); - void exclusiveOptional(); - void testActionInTwoQActionGroup(); - void unCheckCurrentAction(); -}; - -void tst_QGuiActionGroup::enabledPropagation() -{ - QGuiActionGroup testActionGroup(nullptr); - - auto childAction = new QGuiAction( &testActionGroup ); - auto anotherChildAction = new QGuiAction( &testActionGroup ); - auto freeAction = new QGuiAction(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 ); - auto lastChildAction = new QGuiAction(&testActionGroup); - - QVERIFY(!lastChildAction->isEnabled()); - testActionGroup.setEnabled( true ); - QVERIFY(lastChildAction->isEnabled()); - - freeAction->setEnabled(false); - testActionGroup.addAction(freeAction); - QVERIFY(!freeAction->isEnabled()); - delete freeAction; -} - -void tst_QGuiActionGroup::visiblePropagation() -{ - QGuiActionGroup testActionGroup(nullptr); - - auto childAction = new QGuiAction( &testActionGroup ); - auto anotherChildAction = new QGuiAction( &testActionGroup ); - auto freeAction = new QGuiAction(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 ); - auto lastChildAction = new QGuiAction(&testActionGroup); - - QVERIFY(!lastChildAction->isVisible()); - testActionGroup.setVisible( true ); - QVERIFY(lastChildAction->isVisible()); - - freeAction->setVisible(false); - testActionGroup.addAction(freeAction); - QVERIFY(!freeAction->isVisible()); - delete freeAction; -} - -void tst_QGuiActionGroup::exclusive() -{ - QGuiActionGroup group(nullptr); - group.setExclusive(false); - QVERIFY( !group.isExclusive() ); - - auto actOne = new QGuiAction(&group); - actOne->setCheckable( true ); - auto actTwo = new QGuiAction(&group); - actTwo->setCheckable( true ); - auto actThree = new QGuiAction(&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_QGuiActionGroup::exclusiveOptional() -{ - QGuiActionGroup group(0); - group.setExclusive(true); - QVERIFY( group.isExclusive() ); - - auto actOne = new QGuiAction(&group); - actOne->setCheckable( true ); - auto actTwo = new QGuiAction(&group); - actTwo->setCheckable( true ); - auto actThree = new QGuiAction(&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(QGuiActionGroup::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_QGuiActionGroup::testActionInTwoQActionGroup() -{ - QGuiAction action1("Action 1", this); - - QGuiActionGroup group1(this); - QGuiActionGroup group2(this); - - group1.addAction(&action1); - group2.addAction(&action1); - - QCOMPARE(action1.guiActionGroup(), &group2); - QCOMPARE(group2.guiActions().constFirst(), &action1); - QCOMPARE(group1.guiActions().isEmpty(), true); -} - -void tst_QGuiActionGroup::unCheckCurrentAction() -{ - QGuiActionGroup group(nullptr); - QGuiAction 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()); - auto current = group.checkedGuiAction(); - QCOMPARE(current, &action1); - current->setChecked(false); - QVERIFY(!action1.isChecked()); - QVERIFY(!action2.isChecked()); - QVERIFY(!group.checkedGuiAction()); -} - - -QTEST_MAIN(tst_QGuiActionGroup) -#include "tst_qguiactiongroup.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 -#include +#include #include #include #include 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 -#include +#include #include #include #include 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 -#include +#include #include #include #include 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 -#include +#include #include #include #include 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 -#include +#include #include #include #include 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 +#include #include -#include #include #include #include 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 +#include #include -#include #include #include #include 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 -#include +#include #include #include #include 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 #include #include +#include #include #include #include @@ -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 #include #include +#include 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 #include #include -#include +#include #include #include 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 +#include #include 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 +#include #include #include #include -- cgit v1.2.3