diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-15 11:14:22 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-15 14:29:08 +0200 |
commit | e38e1d02cca8056c9efcf2ab186a76396a60f21f (patch) | |
tree | 1e53698d4e7da03fa0f0adc8382d41c225ed469d /tests/auto | |
parent | c61b81c3856d4019880d4350f5138d968ce4bd96 (diff) |
Add QButtonGroup::idClicked/Pressed/Released/Toggled signals
Following the deprecation of the signal overloads, the remaining signals
did not provide equivalent functionality for connecting a slot expecting
an integer. The mapping from QAbstractButton* to the ID is comparatively
cumbersome to do in the connected slot.
Add uniquely named signals that emit the ID of the button directly.
[ChangeLog][QtWidgets][QButtonGroup] Added signals
idClicked/Pressed/Released/Toggled that replace the deprecated signal
overloads.
Change-Id: I77215e4f815c4fb7dd6326e1f431230e6601e8f8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp b/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp index 3b8bcf98c3..7454acbec7 100644 --- a/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp +++ b/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp @@ -365,11 +365,11 @@ void tst_QButtonGroup::testSignals() qRegisterMetaType<QAbstractButton *>("QAbstractButton *"); QSignalSpy clickedSpy(&buttons, SIGNAL(buttonClicked(QAbstractButton*))); - QSignalSpy clickedIdSpy(&buttons, SIGNAL(buttonClicked(int))); + QSignalSpy clickedIdSpy(&buttons, SIGNAL(idClicked(int))); QSignalSpy pressedSpy(&buttons, SIGNAL(buttonPressed(QAbstractButton*))); - QSignalSpy pressedIdSpy(&buttons, SIGNAL(buttonPressed(int))); + QSignalSpy pressedIdSpy(&buttons, SIGNAL(idPressed(int))); QSignalSpy releasedSpy(&buttons, SIGNAL(buttonReleased(QAbstractButton*))); - QSignalSpy releasedIdSpy(&buttons, SIGNAL(buttonReleased(int))); + QSignalSpy releasedIdSpy(&buttons, SIGNAL(idReleased(int))); pb1.animateClick(); QTestEventLoop::instance().enterLoop(1); @@ -409,7 +409,7 @@ void tst_QButtonGroup::testSignals() QSignalSpy toggledSpy(&buttons, SIGNAL(buttonToggled(QAbstractButton*, bool))); - QSignalSpy toggledIdSpy(&buttons, SIGNAL(buttonToggled(int, bool))); + QSignalSpy toggledIdSpy(&buttons, SIGNAL(idToggled(int, bool))); pb1.setCheckable(true); pb2.setCheckable(true); |