summaryrefslogtreecommitdiffstats
path: root/examples/widgets/animation/stickman
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/animation/stickman')
-rw-r--r--examples/widgets/animation/stickman/graphicsview.cpp4
-rw-r--r--examples/widgets/animation/stickman/graphicsview.h2
-rw-r--r--examples/widgets/animation/stickman/lifecycle.cpp7
-rw-r--r--examples/widgets/animation/stickman/stickman.cpp3
4 files changed, 8 insertions, 8 deletions
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 <QtWidgets/QGraphicsScene>
#include <QtWidgets/QGraphicsView>
-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; i<frameCount; ++i) {
animation.setCurrentFrame(i);
@@ -204,7 +203,7 @@ QState *LifeCycle::makeState(QState *parentState, const QString &animationFileNa
//! [1]
frameState->setObjectName(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 *)