diff options
Diffstat (limited to 'examples/opengl')
-rw-r--r-- | examples/opengl/legacy/overpainting/glwidget.cpp | 6 | ||||
-rw-r--r-- | examples/opengl/qopenglwidget/glwidget.cpp | 7 |
2 files changed, 3 insertions, 10 deletions
diff --git a/examples/opengl/legacy/overpainting/glwidget.cpp b/examples/opengl/legacy/overpainting/glwidget.cpp index f98d043c5c..0094f8ead7 100644 --- a/examples/opengl/legacy/overpainting/glwidget.cpp +++ b/examples/opengl/legacy/overpainting/glwidget.cpp @@ -247,12 +247,8 @@ void GLWidget::createBubbles(int number) //! [13] void GLWidget::animate() { - QMutableListIterator<Bubble*> iter(bubbles); - - while (iter.hasNext()) { - Bubble *bubble = iter.next(); + for (Bubble *bubble : qAsConst(bubbles)) bubble->move(rect()); - } update(); } //! [13] diff --git a/examples/opengl/qopenglwidget/glwidget.cpp b/examples/opengl/qopenglwidget/glwidget.cpp index 946b2bec67..5057291f12 100644 --- a/examples/opengl/qopenglwidget/glwidget.cpp +++ b/examples/opengl/qopenglwidget/glwidget.cpp @@ -399,12 +399,9 @@ void GLWidget::paintGL() painter.end(); - QMutableListIterator<Bubble*> iter(m_bubbles); - - while (iter.hasNext()) { - Bubble *bubble = iter.next(); + for (Bubble *bubble : qAsConst(m_bubbles)) bubble->move(rect()); - } + if (!(m_frames % 100)) { m_time.start(); m_frames = 0; |