summaryrefslogtreecommitdiffstats
path: root/examples/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl')
-rw-r--r--examples/opengl/contextinfo/widget.cpp2
-rw-r--r--examples/opengl/legacy/overpainting/glwidget.cpp2
-rw-r--r--examples/opengl/qopenglwidget/glwidget.cpp6
-rw-r--r--examples/opengl/qopenglwidget/mainwindow.cpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/examples/opengl/contextinfo/widget.cpp b/examples/opengl/contextinfo/widget.cpp
index a5d9e98bf8..b1b7076503 100644
--- a/examples/opengl/contextinfo/widget.cpp
+++ b/examples/opengl/contextinfo/widget.cpp
@@ -387,7 +387,7 @@ void Widget::renderWindowReady()
QList<QByteArray> extensionList = context->extensions().toList();
std::sort(extensionList.begin(), extensionList.end());
m_extensions->append(tr("Found %1 extensions:").arg(extensionList.count()));
- Q_FOREACH (const QByteArray &ext, extensionList)
+ for (const QByteArray &ext : qAsConst(extensionList))
m_extensions->append(QString::fromLatin1(ext));
m_output->moveCursor(QTextCursor::Start);
diff --git a/examples/opengl/legacy/overpainting/glwidget.cpp b/examples/opengl/legacy/overpainting/glwidget.cpp
index 1ec7bd731c..f98d043c5c 100644
--- a/examples/opengl/legacy/overpainting/glwidget.cpp
+++ b/examples/opengl/legacy/overpainting/glwidget.cpp
@@ -201,7 +201,7 @@ void GLWidget::paintEvent(QPaintEvent *event)
//! [10]
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);
- foreach (Bubble *bubble, bubbles) {
+ for (Bubble *bubble : qAsConst(bubbles)) {
if (bubble->rect().intersects(event->rect()))
bubble->drawBubble(&painter);
}
diff --git a/examples/opengl/qopenglwidget/glwidget.cpp b/examples/opengl/qopenglwidget/glwidget.cpp
index 3fe919f94b..946b2bec67 100644
--- a/examples/opengl/qopenglwidget/glwidget.cpp
+++ b/examples/opengl/qopenglwidget/glwidget.cpp
@@ -385,10 +385,10 @@ void GLWidget::paintGL()
painter.endNativePainting();
- if (m_showBubbles)
- foreach (Bubble *bubble, m_bubbles) {
+ if (m_showBubbles) {
+ for (Bubble *bubble : qAsConst(m_bubbles))
bubble->drawBubble(&painter);
- }
+ }
if (const int elapsed = m_time.elapsed()) {
QString framesPerSecond;
diff --git a/examples/opengl/qopenglwidget/mainwindow.cpp b/examples/opengl/qopenglwidget/mainwindow.cpp
index 4bd123628f..6fab3df79e 100644
--- a/examples/opengl/qopenglwidget/mainwindow.cpp
+++ b/examples/opengl/qopenglwidget/mainwindow.cpp
@@ -176,7 +176,7 @@ void MainWindow::timerUsageChanged(bool enabled)
m_timer->start();
} else {
m_timer->stop();
- foreach (QOpenGLWidget *w, m_glWidgets)
+ for (QOpenGLWidget *w : qAsConst(m_glWidgets))
w->update();
}
}