summaryrefslogtreecommitdiffstats
path: root/examples/widgets/animation/stickman/animation.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-04-16 16:32:08 +0200
committerTobias Hunger <tobias.hunger@qt.io>2019-04-16 16:32:08 +0200
commit6630937e63ae5797487b86743a7733c8ae5cc42c (patch)
tree3d53dacf6430f9099e1fb20835881205de674961 /examples/widgets/animation/stickman/animation.cpp
parent37ed6dae00640f9cc980ffda05347c12a7eb5d7e (diff)
parentc7af193d2e49e9f10b86262e63d8d13abf72b5cf (diff)
Merge commit 'dev' into 'wip/cmake-merge'
Diffstat (limited to 'examples/widgets/animation/stickman/animation.cpp')
-rw-r--r--examples/widgets/animation/stickman/animation.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/widgets/animation/stickman/animation.cpp b/examples/widgets/animation/stickman/animation.cpp
index 94a92749bc..5c2d1682af 100644
--- a/examples/widgets/animation/stickman/animation.cpp
+++ b/examples/widgets/animation/stickman/animation.cpp
@@ -159,18 +159,16 @@ void Animation::save(QIODevice *device) const
QDataStream stream(device);
stream << m_name;
stream << m_frames.size();
- foreach (Frame *frame, m_frames) {
+ for (const Frame *frame : qAsConst(m_frames)) {
stream << frame->nodeCount();
- for (int i=0; i<frame->nodeCount(); ++i)
+ for (int i = 0; i < frame->nodeCount(); ++i)
stream << frame->nodePos(i);
}
}
void Animation::load(QIODevice *device)
{
- if (!m_frames.isEmpty())
- qDeleteAll(m_frames);
-
+ qDeleteAll(m_frames);
m_frames.clear();
QDataStream stream(device);