diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-11-22 14:46:58 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-12-06 12:13:20 +0100 |
commit | ece0c0a5e7e0b18beb58ccd868bde54c7be64f78 (patch) | |
tree | fa4a0fdbda040d24f1a2d07a320635c76980f431 /src/widgets/dialogs/qprogressdialog.cpp | |
parent | b19220d17fa66de5ded41690ffff263ee2af5c63 (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/dialogs/qprogressdialog.cpp')
-rw-r--r-- | src/widgets/dialogs/qprogressdialog.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp index 189dcd2989..94d3928c8b 100644 --- a/src/widgets/dialogs/qprogressdialog.cpp +++ b/src/widgets/dialogs/qprogressdialog.cpp @@ -65,13 +65,13 @@ class QProgressDialogPrivate : public QDialogPrivate Q_DECLARE_PUBLIC(QProgressDialog) public: - QProgressDialogPrivate() : label(0), cancel(0), bar(0), + QProgressDialogPrivate() : label(nullptr), cancel(nullptr), bar(nullptr), shown_once(false), cancellation_flag(false), setValue_called(false), showTime(defaultShowTime), #ifndef QT_NO_SHORTCUT - escapeShortcut(0), + escapeShortcut(nullptr), #endif useDefaultCancelText(false) { @@ -112,7 +112,7 @@ void QProgressDialogPrivate::init(const QString &labelText, const QString &cance label = new QLabel(labelText, q); bar = new QProgressBar(q); bar->setRange(min, max); - int align = q->style()->styleHint(QStyle::SH_ProgressDialog_TextLabelAlignment, 0, q); + int align = q->style()->styleHint(QStyle::SH_ProgressDialog_TextLabelAlignment, nullptr, q); label->setAlignment(Qt::Alignment(align)); autoClose = true; autoReset = true; @@ -132,12 +132,12 @@ void QProgressDialogPrivate::init(const QString &labelText, const QString &cance void QProgressDialogPrivate::layout() { Q_Q(QProgressDialog); - int sp = q->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing, 0, q); - int mb = q->style()->pixelMetric(QStyle::PM_LayoutBottomMargin, 0, q); - int ml = qMin(q->width() / 10, q->style()->pixelMetric(QStyle::PM_LayoutLeftMargin, 0, q)); - int mr = qMin(q->width() / 10, q->style()->pixelMetric(QStyle::PM_LayoutRightMargin, 0, q)); + int sp = q->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing, nullptr, q); + int mb = q->style()->pixelMetric(QStyle::PM_LayoutBottomMargin, nullptr, q); + int ml = qMin(q->width() / 10, q->style()->pixelMetric(QStyle::PM_LayoutLeftMargin, nullptr, q)); + int mr = qMin(q->width() / 10, q->style()->pixelMetric(QStyle::PM_LayoutRightMargin, nullptr, q)); const bool centered = - bool(q->style()->styleHint(QStyle::SH_ProgressDialog_CenterCancelButton, 0, q)); + bool(q->style()->styleHint(QStyle::SH_ProgressDialog_CenterCancelButton, nullptr, q)); int additionalSpacing = 0; QSize cs = cancel ? cancel->sizeHint() : QSize(0,0); @@ -188,7 +188,7 @@ void QProgressDialogPrivate::_q_disconnectOnClose() if (receiverToDisconnectOnClose) { QObject::disconnect(q, SIGNAL(canceled()), receiverToDisconnectOnClose, memberToDisconnectOnClose); - receiverToDisconnectOnClose = 0; + receiverToDisconnectOnClose = nullptr; } memberToDisconnectOnClose.clear(); } @@ -418,7 +418,7 @@ void QProgressDialog::setCancelButton(QPushButton *cancelButton) } else { #ifndef QT_NO_SHORTCUT delete d->escapeShortcut; - d->escapeShortcut = 0; + d->escapeShortcut = nullptr; #endif } d->adoptChildWidget(cancelButton); @@ -450,7 +450,7 @@ void QProgressDialogPrivate::setCancelButtonText(const QString &cancelButtonText q->setCancelButton(new QPushButton(cancelButtonText, q)); } } else { - q->setCancelButton(0); + q->setCancelButton(nullptr); } ensureSizeIsAtLeastSizeHint(); } |