diff options
Diffstat (limited to 'src/widgets/widgets/qabstractbutton.cpp')
-rw-r--r-- | src/widgets/widgets/qabstractbutton.cpp | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index d956d2ba23..7961d0a21b 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -177,7 +177,7 @@ QAbstractButtonPrivate::QAbstractButtonPrivate(QSizePolicy::ControlType type) checkable(false), checked(false), autoRepeat(false), autoExclusive(false), down(false), blockRefresh(false), pressed(false), #if QT_CONFIG(buttongroup) - group(0), + group(nullptr), #endif autoRepeatDelay(AUTO_REPEAT_DELAY), autoRepeatInterval(AUTO_REPEAT_INTERVAL), @@ -217,14 +217,14 @@ QAbstractButton *QAbstractButtonPrivate::queryCheckedButton() const Q_Q(const QAbstractButton); QList<QAbstractButton *> buttonList = queryButtonList(); if (!autoExclusive || buttonList.count() == 1) // no group - return 0; + return nullptr; for (int i = 0; i < buttonList.count(); ++i) { QAbstractButton *b = buttonList.at(i); if (b->d_func()->checked && b != q) return b; } - return checked ? const_cast<QAbstractButton *>(q) : 0; + return checked ? const_cast<QAbstractButton *>(q) : nullptr; } void QAbstractButtonPrivate::notifyChecked() @@ -257,7 +257,7 @@ void QAbstractButtonPrivate::moveFocus(int key) if (!fb || !buttonList.contains(fb)) return; - QAbstractButton *candidate = 0; + QAbstractButton *candidate = nullptr; int bestScore = -1; QRect target = f->rect().translated(f->mapToGlobal(QPoint(0,0))); QPoint goal = target.center(); @@ -415,8 +415,13 @@ void QAbstractButtonPrivate::emitClicked() emit q->clicked(checked); #if QT_CONFIG(buttongroup) if (guard && group) { +#if QT_DEPRECATED_SINCE(5, 15) +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED emit group->buttonClicked(group->id(q)); if (guard && group) +QT_WARNING_POP +#endif emit group->buttonClicked(q); } #endif @@ -429,8 +434,13 @@ void QAbstractButtonPrivate::emitPressed() emit q->pressed(); #if QT_CONFIG(buttongroup) if (guard && group) { +#if QT_DEPRECATED_SINCE(5, 15) +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED emit group->buttonPressed(group->id(q)); if (guard && group) +QT_WARNING_POP +#endif emit group->buttonPressed(q); } #endif @@ -443,8 +453,13 @@ void QAbstractButtonPrivate::emitReleased() emit q->released(); #if QT_CONFIG(buttongroup) if (guard && group) { +#if QT_DEPRECATED_SINCE(5, 15) +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED emit group->buttonReleased(group->id(q)); if (guard && group) +QT_WARNING_POP +#endif emit group->buttonReleased(q); } #endif @@ -457,8 +472,13 @@ void QAbstractButtonPrivate::emitToggled(bool checked) emit q->toggled(checked); #if QT_CONFIG(buttongroup) if (guard && group) { +#if QT_DEPRECATED_SINCE(5, 15) +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED emit group->buttonToggled(group->id(q), checked); if (guard && group) +QT_WARNING_POP +#endif emit group->buttonToggled(q, checked); } #endif @@ -468,7 +488,7 @@ void QAbstractButtonPrivate::emitToggled(bool checked) Constructs an abstract button with a \a parent. */ QAbstractButton::QAbstractButton(QWidget *parent) - : QWidget(*new QAbstractButtonPrivate, parent, 0) + : QWidget(*new QAbstractButtonPrivate, parent, { }) { Q_D(QAbstractButton); d->init(); @@ -490,7 +510,7 @@ QAbstractButton::QAbstractButton(QWidget *parent) /*! \internal */ QAbstractButton::QAbstractButton(QAbstractButtonPrivate &dd, QWidget *parent) - : QWidget(dd, parent, 0) + : QWidget(dd, parent, { }) { Q_D(QAbstractButton); d->init(); @@ -1272,7 +1292,7 @@ QSize QAbstractButton::iconSize() const Q_D(const QAbstractButton); if (d->iconSize.isValid()) return d->iconSize; - int e = style()->pixelMetric(QStyle::PM_ButtonIconSize, 0, this); + int e = style()->pixelMetric(QStyle::PM_ButtonIconSize, nullptr, this); return QSize(e, e); } |