summaryrefslogtreecommitdiffstats
path: root/examples/widgets/animation/stickman/animation.cpp
diff options
context:
space:
mode:
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);