summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-07-13 14:31:36 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-07-15 05:25:13 +0000
commit8155d0693f596c6b73d0acd977d5077dd7a6e6ea (patch)
tree859aaefb5557991366c15a007624498b63784a89 /src/plugins/platforms
parent72d9222f7bda744f80d3602d3bfe5769ed1f19a8 (diff)
Eradicate Q_FOREACH in the WASM plugin and mark the plugin free of them
The first one is trivially correct: it clearly doesn't modify the container under iteration. The second is a bit more subtle, because drawWindow() could be expected to call a paintEvent and this could theoretically lead to lowering, closing, or opening of a window. But this function just ends up blit()ting, so it doesn't call into user code. Change-Id: Id15e0102e9c8aa12516af27d771104e9993c48a1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/wasm/qwasmcompositor.cpp4
-rw-r--r--src/plugins/platforms/wasm/wasm.pro2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp
index 6d211667be..a810880c43 100644
--- a/src/plugins/platforms/wasm/qwasmcompositor.cpp
+++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp
@@ -681,7 +681,7 @@ void QWasmCompositor::frame()
QWasmWindow *someWindow = nullptr;
- foreach (QWasmWindow *window, m_windowStack) {
+ for (QWasmWindow *window : qAsConst(m_windowStack)) {
if (window->window()->surfaceClass() == QSurface::Window
&& qt_window_private(static_cast<QWindow *>(window->window()))->receivedExpose) {
someWindow = window;
@@ -715,7 +715,7 @@ void QWasmCompositor::frame()
m_blitter->bind();
m_blitter->setRedBlueSwizzle(true);
- foreach (QWasmWindow *window, m_windowStack) {
+ for (QWasmWindow *window : qAsConst(m_windowStack)) {
QWasmCompositedWindow &compositedWindow = m_compositedWindows[window];
if (!compositedWindow.visible)
diff --git a/src/plugins/platforms/wasm/wasm.pro b/src/plugins/platforms/wasm/wasm.pro
index c28df8f893..f8c8175525 100644
--- a/src/plugins/platforms/wasm/wasm.pro
+++ b/src/plugins/platforms/wasm/wasm.pro
@@ -7,6 +7,8 @@ QT += \
# Avoid X11 header collision, use generic EGL native types
DEFINES += QT_EGL_NO_X11
+DEFINES += QT_NO_FOREACH
+
SOURCES = \
main.cpp \
qwasmintegration.cpp \