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>
This commit is contained in:
Jason McDonald 2012-04-11 23:46:41 +10:00 committed by Qt by Nokia
parent 2f4b9b8e42
commit b317fe2a60
3 changed files with 7 additions and 23 deletions

View File

@ -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) void QButtonGroup::addButton(QAbstractButton *button, int id)
{ {
Q_D(QButtonGroup); Q_D(QButtonGroup);

View File

@ -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 Adds the given \a button to the button group. If \a id is -1,
of buttons. An id will be assigned to the button by this an id will be assigned to the button by this QButtonGroup.
QButtonGroup. Automatically assigned ids are guaranteed to be Automatically assigned ids are guaranteed to be negative,
negative, starting with -2. If you are also assigning your own starting with -2. If you are assigning your own ids, use
ids, use positive values to avoid conflicts. 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.
\sa removeButton() buttons() \sa removeButton() buttons()
*/ */

View File

@ -67,8 +67,7 @@ public:
void setExclusive(bool); void setExclusive(bool);
bool exclusive() const; bool exclusive() const;
void addButton(QAbstractButton *); void addButton(QAbstractButton *, int id = -1);
void addButton(QAbstractButton *, int id);
void removeButton(QAbstractButton *); void removeButton(QAbstractButton *);
QList<QAbstractButton*> buttons() const; QList<QAbstractButton*> buttons() const;