summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qwizard.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/dialogs/qwizard.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/dialogs/qwizard.cpp')
-rw-r--r--src/widgets/dialogs/qwizard.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index 7c4a473976..a4789f40b1 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -115,7 +115,7 @@ static QWidget *iWantTheFocus(QWidget *ancestor)
return candidate;
}
}
- return 0;
+ return nullptr;
}
static bool objectInheritsXAndXIsCloserThanY(const QObject *object, const QByteArray &classX,
@@ -165,7 +165,7 @@ static const char *changed_signal(int which)
};
Q_STATIC_ASSERT(7 == NFallbackDefaultProperties);
Q_UNREACHABLE();
- return 0;
+ return nullptr;
}
class QWizardDefaultProperty
@@ -286,9 +286,9 @@ class QWizardHeader : public QWidget
public:
enum RulerType { Ruler };
- inline QWizardHeader(RulerType /* ruler */, QWidget *parent = 0)
+ inline QWizardHeader(RulerType /* ruler */, QWidget *parent = nullptr)
: QWidget(parent) { setFixedHeight(2); }
- QWizardHeader(QWidget *parent = 0);
+ QWizardHeader(QWidget *parent = nullptr);
void setup(const QWizardLayoutInfo &info, const QString &title,
const QString &subTitle, const QPixmap &logo, const QPixmap &banner,
@@ -438,7 +438,7 @@ void QWizardHeader::paintEvent(QPaintEvent * /* event */)
class QWizardRuler : public QWizardHeader
{
public:
- inline QWizardRuler(QWidget *parent = 0)
+ inline QWizardRuler(QWidget *parent = nullptr)
: QWizardHeader(Ruler, parent) {}
};
@@ -684,7 +684,7 @@ void QWizardPrivate::init()
std::fill(btns, btns + QWizard::NButtons, nullptr);
antiFlickerWidget = new QWizardAntiFlickerWidget(q, this);
- wizStyle = QWizard::WizardStyle(q->style()->styleHint(QStyle::SH_WizardStyle, 0, q));
+ wizStyle = QWizard::WizardStyle(q->style()->styleHint(QStyle::SH_WizardStyle, nullptr, q));
if (wizStyle == QWizard::MacStyle) {
opts = (QWizard::NoDefaultButton | QWizard::NoCancelButton);
} else if (wizStyle == QWizard::ModernStyle) {
@@ -836,7 +836,7 @@ void QWizardPrivate::switchToPage(int newId, Direction direction)
newPage && newPage->isCommitPage() ? QWizard::CommitButton : QWizard::NextButton;
QAbstractButton *nextOrFinishButton =
btns[canContinue ? nextOrCommit : QWizard::FinishButton];
- QWidget *candidate = 0;
+ QWidget *candidate = nullptr;
/*
If there is no default button and the Next or Finish button
@@ -887,7 +887,7 @@ static const char * buttonSlots(QWizard::WizardButton which)
case QWizard::NoButton:
Q_UNREACHABLE();
};
- return 0;
+ return nullptr;
};
QWizardLayoutInfo QWizardPrivate::layoutInfoForCurrentPage()
@@ -898,14 +898,14 @@ QWizardLayoutInfo QWizardPrivate::layoutInfoForCurrentPage()
QWizardLayoutInfo info;
const int layoutHorizontalSpacing = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
- info.topLevelMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin, 0, q);
- info.topLevelMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin, 0, q);
- info.topLevelMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin, 0, q);
- info.topLevelMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin, 0, q);
- info.childMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin, 0, titleLabel);
- info.childMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin, 0, titleLabel);
- info.childMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin, 0, titleLabel);
- info.childMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin, 0, titleLabel);
+ info.topLevelMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin, nullptr, q);
+ info.topLevelMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin, nullptr, q);
+ info.topLevelMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin, nullptr, q);
+ info.topLevelMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin, nullptr, q);
+ info.childMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin, nullptr, titleLabel);
+ info.childMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin, nullptr, titleLabel);
+ info.childMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin, nullptr, titleLabel);
+ info.childMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin, nullptr, titleLabel);
info.hspacing = (layoutHorizontalSpacing == -1)
? style->layoutSpacing(QSizePolicy::DefaultType, QSizePolicy::DefaultType, Qt::Horizontal)
: layoutHorizontalSpacing;
@@ -959,7 +959,7 @@ void QWizardPrivate::recreateLayout(const QWizardLayoutInfo &info)
for (int i = mainLayout->count() - 1; i >= 0; --i) {
QLayoutItem *item = mainLayout->takeAt(i);
if (item->layout()) {
- item->layout()->setParent(0);
+ item->layout()->setParent(nullptr);
} else {
delete item;
}
@@ -2281,7 +2281,7 @@ void QWizard::removePage(int id)
{
Q_D(QWizard);
- QWizardPage *removedPage = 0;
+ QWizardPage *removedPage = nullptr;
// update startItem accordingly
if (d->pageMap.count() > 0) { // only if we have any pages
@@ -2792,7 +2792,7 @@ QAbstractButton *QWizard::button(WizardButton which) const
return d->vistaHelper->backButton();
#endif
if (!d->ensureButton(which))
- return 0;
+ return nullptr;
return d->btns[which];
}