summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2012-04-11 23:46:41 +1000
committerQt by Nokia <qt-info@nokia.com>2012-04-13 10:44:28 +0200
commitb317fe2a606e5b79f24b1e4a1b808f5ff66d3621 (patch)
tree7f831e720d346ad42e2c134fc4d9f009867d58af
parent2f4b9b8e4226fe8d1d1f413965c2efcaed98c7d4 (diff)
Merge the two overloads of QButtonGroup::addButton().
This change is source-compatible, but binary-incompatible. Task-number: QTBUG-25101 Change-Id: If67aec2ca8dd54ad9315f6497c2dafbbbc0b775f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp6
-rw-r--r--src/widgets/widgets/qbuttongroup.cpp21
-rw-r--r--src/widgets/widgets/qbuttongroup.h3
3 files changed, 7 insertions, 23 deletions
diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp
index 5f75bd3913..4e85eae3ff 100644
--- a/src/widgets/widgets/qabstractbutton.cpp
+++ b/src/widgets/widgets/qabstractbutton.cpp
@@ -219,12 +219,6 @@ void QButtonGroup::setExclusive(bool exclusive)
}
-// TODO: Qt 5: Merge with addButton(QAbstractButton *button, int id)
-void QButtonGroup::addButton(QAbstractButton *button)
-{
- addButton(button, -1);
-}
-
void QButtonGroup::addButton(QAbstractButton *button, int id)
{
Q_D(QButtonGroup);
diff --git a/src/widgets/widgets/qbuttongroup.cpp b/src/widgets/widgets/qbuttongroup.cpp
index 381e32d96b..a5e96370cf 100644
--- a/src/widgets/widgets/qbuttongroup.cpp
+++ b/src/widgets/widgets/qbuttongroup.cpp
@@ -175,22 +175,13 @@
*/
/*!
- \fn void QButtonGroup::addButton(QAbstractButton *button);
+ \fn void QButtonGroup::addButton(QAbstractButton *button, int id = -1);
- Adds the given \a button to the end of the group's internal list
- of buttons. An id will be assigned to the button by this
- QButtonGroup. Automatically assigned ids are guaranteed to be
- negative, starting with -2. If you are also assigning your own
- ids, use positive values to avoid conflicts.
-
- \sa removeButton() buttons()
-*/
-
-/*!
- \fn void QButtonGroup::addButton(QAbstractButton *button, int id);
-
- Adds the given \a button to the button group, with the given \a
- id. It is recommended to assign only positive ids.
+ Adds the given \a button to the button group. If \a id is -1,
+ an id will be assigned to the button by this QButtonGroup.
+ Automatically assigned ids are guaranteed to be negative,
+ starting with -2. If you are assigning your own ids, use
+ positive values to avoid conflicts.
\sa removeButton() buttons()
*/
diff --git a/src/widgets/widgets/qbuttongroup.h b/src/widgets/widgets/qbuttongroup.h
index e24ac8bbc3..46275d9f04 100644
--- a/src/widgets/widgets/qbuttongroup.h
+++ b/src/widgets/widgets/qbuttongroup.h
@@ -67,8 +67,7 @@ public:
void setExclusive(bool);
bool exclusive() const;
- void addButton(QAbstractButton *);
- void addButton(QAbstractButton *, int id);
+ void addButton(QAbstractButton *, int id = -1);
void removeButton(QAbstractButton *);
QList<QAbstractButton*> buttons() const;