From aa32510430d6a5e58cb456faeb072d9f189872fe Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 2 Dec 2018 14:11:13 +0100 Subject: Cleanup Widgets examples - nullptr Cleanup the widgets examples - replace 0 with nullptr Change-Id: Id4bf119b9a41f6d10117f3a613a6e604128fa196 Reviewed-by: Konstantin Shegunov Reviewed-by: Edward Welbourne Reviewed-by: Paul Wicking --- examples/widgets/animation/stickman/graphicsview.cpp | 4 +++- examples/widgets/animation/stickman/graphicsview.h | 2 +- examples/widgets/animation/stickman/lifecycle.cpp | 7 +++---- examples/widgets/animation/stickman/stickman.cpp | 3 +-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'examples/widgets/animation/stickman') diff --git a/examples/widgets/animation/stickman/graphicsview.cpp b/examples/widgets/animation/stickman/graphicsview.cpp index 9cb57fcd9e..7058e15345 100644 --- a/examples/widgets/animation/stickman/graphicsview.cpp +++ b/examples/widgets/animation/stickman/graphicsview.cpp @@ -55,7 +55,9 @@ #include #include -GraphicsView::GraphicsView(QWidget *parent) : QGraphicsView(parent), m_editor(0) {} +GraphicsView::GraphicsView(QWidget *parent) + : QGraphicsView(parent), m_editor(nullptr) +{} void GraphicsView::keyPressEvent(QKeyEvent *e) { diff --git a/examples/widgets/animation/stickman/graphicsview.h b/examples/widgets/animation/stickman/graphicsview.h index 56396bb780..361fee219d 100644 --- a/examples/widgets/animation/stickman/graphicsview.h +++ b/examples/widgets/animation/stickman/graphicsview.h @@ -58,7 +58,7 @@ class GraphicsView: public QGraphicsView { Q_OBJECT public: - GraphicsView(QWidget *parent = 0); + GraphicsView(QWidget *parent = nullptr); protected: void resizeEvent(QResizeEvent *event) override; diff --git a/examples/widgets/animation/stickman/lifecycle.cpp b/examples/widgets/animation/stickman/lifecycle.cpp index 5d4c406b2e..046e3f4cd1 100644 --- a/examples/widgets/animation/stickman/lifecycle.cpp +++ b/examples/widgets/animation/stickman/lifecycle.cpp @@ -175,9 +175,8 @@ void LifeCycle::addActivity(const QString &fileName, Qt::Key key, QObject *sende QState *state = makeState(m_alive, fileName); m_alive->addTransition(new KeyPressTransition(m_keyReceiver, key, state)); - if((sender != NULL) || (signal != NULL)) { + if (sender || signal) m_alive->addTransition(sender, signal, state); - } } QState *LifeCycle::makeState(QState *parentState, const QString &animationFileName) @@ -192,7 +191,7 @@ QState *LifeCycle::makeState(QState *parentState, const QString &animationFileNa } const int frameCount = animation.totalFrames(); - QState *previousState = 0; + QState *previousState = nullptr; for (int i=0; isetObjectName(QString::fromLatin1("frame %0").arg(i)); - if (previousState == 0) + if (previousState == nullptr) topLevel->setInitialState(frameState); else //! [2] diff --git a/examples/widgets/animation/stickman/stickman.cpp b/examples/widgets/animation/stickman/stickman.cpp index 8b183d87d5..5725f64eec 100644 --- a/examples/widgets/animation/stickman/stickman.cpp +++ b/examples/widgets/animation/stickman/stickman.cpp @@ -176,8 +176,7 @@ Node *StickMan::node(int idx) const { if (idx >= 0 && idx < NodeCount) return m_nodes[idx]; - else - return 0; + return nullptr; } void StickMan::timerEvent(QTimerEvent *) -- cgit v1.2.3