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>
This commit is contained in:
parent
72d9222f7b
commit
8155d0693f
@ -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)
|
||||
|
@ -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 \
|
||||
|
Loading…
Reference in New Issue
Block a user