qt5base-lts/tests/auto
Volker Hilsheimer 188d739400 Sync default action when checking tool button programmatically
QAbstractButton::setChecked is not virtual, so QToolButton cannot
override to synchronize the default action's checked state. This resulted
in button and default action not being in sync when the checked state
of the button was changed programmatically, while changing the checked
state on the action kept the button in sync.

Connect to the button's own toggled signal instead to keep the state of
the default action in sync. Make it a unique connection to allow multiple
calls to setDefaultAction, which are used by QToolButton to keep the
button updated if properties of the default action change.

Add a test that confirms that button and action are synchronized both
ways, and that we only get single signal emissions when changing either
programmatically.

Fixes: QTBUG-95255
Pick-to: 6.2 6.1
Change-Id: I0e027faf1da763ef1878e46e85bfa70073c8bf82
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-07-22 16:17:49 +02:00
..
bic/data Add binary compatibility files for Qt 6.0.0 2021-04-08 06:34:13 +00:00
cmake CMake: Disable test_QT_TESTCASE_BUILDDIR cmake build test 2021-07-22 15:56:37 +02:00
concurrent Fix QtConcurrent to properly work with functors 2021-07-21 09:46:33 +02:00
corelib QSet: extend tests 2021-07-22 16:17:49 +02:00
dbus Port QDBusServiceWatcher::watchedServices to bindable properties 2021-04-28 16:59:53 +02:00
gui emit layoutAboutToBeChanged timely 2021-07-20 21:27:27 +01:00
guiapplauncher
network QNetworkReply: Add two new signals 2021-07-20 22:08:39 +02:00
opengl Remove the qmake project files 2021-01-07 15:32:28 +01:00
other Fix crash in concurrent disconnect 2021-06-17 08:56:22 +02:00
printsupport Remove the qmake project files 2021-01-07 15:32:28 +01:00
shared Remove false Q_UNREACHABLE from shaping code 2021-02-03 09:44:44 +01:00
sql QSqlTableModel::orderByClause(): Quote the table name 2021-05-03 14:10:36 +00:00
testlib CMake: Fix Windows resource compiler failure in selftests with MinGW 2021-07-22 15:56:37 +02:00
tools Test Q_CLASSINFO("foobar", #__VA_ARGS__) in tst_moc 2021-07-08 08:17:34 +02:00
widgets Sync default action when checking tool button programmatically 2021-07-22 16:17:49 +02:00
xml tst_qdom: clean-up the code enabled only before Qt 6 2021-01-15 15:22:08 +01:00
CMakeLists.txt CMake: Build minimal subset of tests in desktop static builds 2021-04-06 09:15:37 +01:00
network-settings.h Replace QtTest headers with QTest 2020-12-22 15:20:30 +01:00