summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qabstractbutton.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-22 14:46:58 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-12-06 12:13:20 +0100
commitece0c0a5e7e0b18beb58ccd868bde54c7be64f78 (patch)
treefa4a0fdbda040d24f1a2d07a320635c76980f431 /src/widgets/widgets/qabstractbutton.cpp
parentb19220d17fa66de5ded41690ffff263ee2af5c63 (diff)
Tidy nullptr usage
Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/widgets/qabstractbutton.cpp')
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp
index 19528d61d2..022f41738c 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();
@@ -1272,7 +1272,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);
}