summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-21 01:00:10 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-04-22 15:28:01 +0200
commitefd7757154e1fb946a51c7d90b8cbf56b4df8b6d (patch)
treef757e14770d82ee8376fa10006973c0e750b1e16 /tests/auto/widgets
parent1c80d056e4f45b4ee7c4863cd792e83c889513c5 (diff)
parente10e5318bc02a48a866b76b6f0b7f268d16af642 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/widgets/widgets/qabstractbutton.cpp src/widgets/widgets/qbuttongroup.cpp src/widgets/widgets/qbuttongroup.h src/widgets/widgets/qsplashscreen.cpp tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp tests/benchmarks/opengl/main.cpp Needed update: src/plugins/platforms/cocoa/CMakeLists.txt Change-Id: I7be4baebb63844ec2b3e0de859ca9de1bc730bb5
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm1
-rw-r--r--tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp26
2 files changed, 25 insertions, 2 deletions
diff --git a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm
index 44b6423f1c..00cc6a879f 100644
--- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm
+++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm
@@ -26,7 +26,6 @@
**
****************************************************************************/
-#include <private/qt_mac_p.h>
#include <AppKit/AppKit.h>
void click_cocoa_button()
diff --git a/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp b/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
index e4f927750e..dd8a3e5839 100644
--- a/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
+++ b/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -365,43 +365,67 @@ void tst_QButtonGroup::testSignals()
qRegisterMetaType<QAbstractButton *>("QAbstractButton *");
QSignalSpy clickedSpy(&buttons, SIGNAL(buttonClicked(QAbstractButton*)));
+ QSignalSpy clickedIdSpy(&buttons, SIGNAL(idClicked(int)));
QSignalSpy pressedSpy(&buttons, SIGNAL(buttonPressed(QAbstractButton*)));
+ QSignalSpy pressedIdSpy(&buttons, SIGNAL(idPressed(int)));
QSignalSpy releasedSpy(&buttons, SIGNAL(buttonReleased(QAbstractButton*)));
+ QSignalSpy releasedIdSpy(&buttons, SIGNAL(idReleased(int)));
pb1.animateClick();
QTestEventLoop::instance().enterLoop(1);
QCOMPARE(clickedSpy.count(), 1);
+ QCOMPARE(clickedIdSpy.count(), 1);
+ int expectedId = -2;
+
+ QCOMPARE(clickedIdSpy.takeFirst().at(0).toInt(), expectedId);
QCOMPARE(pressedSpy.count(), 1);
+ QCOMPARE(pressedIdSpy.count(), 1);
+ QCOMPARE(pressedIdSpy.takeFirst().at(0).toInt(), expectedId);
QCOMPARE(releasedSpy.count(), 1);
+ QCOMPARE(releasedIdSpy.count(), 1);
+ QCOMPARE(releasedIdSpy.takeFirst().at(0).toInt(), expectedId);
clickedSpy.clear();
+ clickedIdSpy.clear();
pressedSpy.clear();
+ pressedIdSpy.clear();
releasedSpy.clear();
+ releasedIdSpy.clear();
pb2.animateClick();
QTestEventLoop::instance().enterLoop(1);
QCOMPARE(clickedSpy.count(), 1);
+ QCOMPARE(clickedIdSpy.count(), 1);
+ QCOMPARE(clickedIdSpy.takeFirst().at(0).toInt(), 23);
QCOMPARE(pressedSpy.count(), 1);
+ QCOMPARE(pressedIdSpy.count(), 1);
+ QCOMPARE(pressedIdSpy.takeFirst().at(0).toInt(), 23);
QCOMPARE(releasedSpy.count(), 1);
+ QCOMPARE(releasedIdSpy.count(), 1);
+ QCOMPARE(releasedIdSpy.takeFirst().at(0).toInt(), 23);
QSignalSpy toggledSpy(&buttons, SIGNAL(buttonToggled(QAbstractButton*, bool)));
+ QSignalSpy toggledIdSpy(&buttons, SIGNAL(idToggled(int, bool)));
pb1.setCheckable(true);
pb2.setCheckable(true);
pb1.toggle();
QCOMPARE(toggledSpy.count(), 1);
+ QCOMPARE(toggledIdSpy.count(), 1);
pb2.toggle();
QCOMPARE(toggledSpy.count(), 3); // equals 3 since pb1 and pb2 are both toggled
+ QCOMPARE(toggledIdSpy.count(), 3);
pb1.setCheckable(false);
pb2.setCheckable(false);
pb1.toggle();
QCOMPARE(toggledSpy.count(), 3);
+ QCOMPARE(toggledIdSpy.count(), 3);
}
void tst_QButtonGroup::task106609()