summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qbuttongroup.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-04-15 11:14:22 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-04-15 14:29:08 +0200
commite38e1d02cca8056c9efcf2ab186a76396a60f21f (patch)
tree1e53698d4e7da03fa0f0adc8382d41c225ed469d /src/widgets/widgets/qbuttongroup.cpp
parentc61b81c3856d4019880d4350f5138d968ce4bd96 (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 'src/widgets/widgets/qbuttongroup.cpp')
-rw-r--r--src/widgets/widgets/qbuttongroup.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/widgets/widgets/qbuttongroup.cpp b/src/widgets/widgets/qbuttongroup.cpp
index 9162029cdb..5b407fc0f0 100644
--- a/src/widgets/widgets/qbuttongroup.cpp
+++ b/src/widgets/widgets/qbuttongroup.cpp
@@ -173,6 +173,16 @@ void QButtonGroup::setExclusive(bool exclusive)
*/
/*!
+ \fn void QButtonGroup::idClicked(int id)
+ \since 5.15
+
+ This signal is emitted when a button with the given \a id is
+ clicked.
+
+ \sa checkedButton(), QAbstractButton::clicked()
+*/
+
+/*!
\fn void QButtonGroup::buttonPressed(QAbstractButton *button)
\since 4.2
@@ -193,6 +203,16 @@ void QButtonGroup::setExclusive(bool exclusive)
*/
/*!
+ \fn void QButtonGroup::idPressed(int id)
+ \since 5.15
+
+ This signal is emitted when a button with the given \a id is
+ pressed down.
+
+ \sa QAbstractButton::pressed()
+*/
+
+/*!
\fn void QButtonGroup::buttonReleased(QAbstractButton *button)
\since 4.2
@@ -213,6 +233,16 @@ void QButtonGroup::setExclusive(bool exclusive)
*/
/*!
+ \fn void QButtonGroup::idReleased(int id)
+ \since 5.15
+
+ This signal is emitted when a button with the given \a id is
+ released.
+
+ \sa QAbstractButton::released()
+*/
+
+/*!
\fn void QButtonGroup::buttonToggled(QAbstractButton *button, bool checked)
\since 5.2
@@ -233,6 +263,15 @@ void QButtonGroup::setExclusive(bool exclusive)
\sa QAbstractButton::toggled()
*/
+/*!
+ \fn void QButtonGroup::idToggled(int id, bool checked)
+ \since 5.15
+
+ This signal is emitted when a button with the given \a id is toggled.
+ \a checked is true if the button is checked, or false if the button is unchecked.
+
+ \sa QAbstractButton::toggled()
+*/
/*!
Adds the given \a button to the button group. If \a id is -1,