summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qplatformwindow.cpp')
-rw-r--r--src/gui/kernel/qplatformwindow.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 0a0facf471..f5ddaa4bb7 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -494,7 +494,8 @@ QPlatformScreen *QPlatformWindow::screenForGeometry(const QRect &newGeometry) co
const QPoint center = newGeometry.isEmpty() ? newGeometry.topLeft() : newGeometry.center();
if (!parent() && currentScreen && !currentScreen->geometry().contains(center)) {
- Q_FOREACH (QPlatformScreen* screen, currentScreen->virtualSiblings()) {
+ const auto screens = currentScreen->virtualSiblings();
+ for (QPlatformScreen *screen : screens) {
if (screen->geometry().contains(center))
return screen;
if (screen->geometry().intersects(newGeometry))