summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-07-12 08:48:19 +0200
committerMarc Mutz <marc.mutz@qt.io>2023-08-02 14:02:33 +0200
commitc91146b9eff65cd8c860d26e09242795300a6b14 (patch)
tree843f0da41ae1146546254f32ba8fee13aa03f6b3 /src/plugins/platforms/eglfs
parent923790832777f3e4d9d9be5eba13a9ffdedcf9e7 (diff)
eglfs plugin: port away from Q_FOREACH
Mark the module are Q_FOREACH-free, so it stays that way. These two instances are risk-free, because the loop is over local variables that the loop bodies clearly do not touch, so the safety copy that Q_FOREACH takes is not required here. Pick-to: 6.6 Change-Id: Ida3c1d51c661d77a59a2ad105e080c3c9b66c53f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/CMakeLists.txt1
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration.cpp3
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsscreen.cpp2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/eglfs/CMakeLists.txt b/src/plugins/platforms/eglfs/CMakeLists.txt
index cebb0fe66e..58c45e466a 100644
--- a/src/plugins/platforms/eglfs/CMakeLists.txt
+++ b/src/plugins/platforms/eglfs/CMakeLists.txt
@@ -34,6 +34,7 @@ qt_internal_add_module(EglFSDeviceIntegrationPrivate
DEFINES
QT_BUILD_EGL_DEVICE_LIB
QT_EGL_NO_X11
+ QT_NO_FOREACH
EGLFS_PREFERRED_PLUGIN=${QT_QPA_DEFAULT_EGLFS_INTEGRATION}
INCLUDE_DIRECTORIES
api
diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
index 42cbdf127c..aafe47ca52 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
@@ -110,7 +110,8 @@ void QEglFSIntegration::initialize()
void QEglFSIntegration::destroy()
{
- foreach (QWindow *w, qGuiApp->topLevelWindows())
+ const auto toplevels = qGuiApp->topLevelWindows();
+ for (QWindow *w : toplevels)
w->destroy();
qt_egl_device_integration()->screenDestroy();
diff --git a/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp
index 72c4a47dbb..c5108be04a 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp
@@ -189,7 +189,7 @@ QPixmap QEglFSScreen::grabWindow(WId wid, int x, int y, int width, int height) c
return QPixmap::fromImage(img).copy(x, y, width, height);
}
- foreach (QOpenGLCompositorWindow *w, windows) {
+ for (QOpenGLCompositorWindow *w : windows) {
const QWindow *window = w->sourceWindow();
if (window->winId() == wid) {
const QRect geom = window->geometry();