summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index c8cf7ddb91f..c1bba59140d 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1509,7 +1509,8 @@ QScreen *QWindowPrivate::screenForGeometry(const QRect &newGeometry)
QScreen *fallback = currentScreen;
QPoint center = newGeometry.center();
if (!q->parent() && currentScreen && !currentScreen->geometry().contains(center)) {
- Q_FOREACH (QScreen* screen, currentScreen->virtualSiblings()) {
+ const auto screens = currentScreen->virtualSiblings();
+ for (QScreen* screen : screens) {
if (screen->geometry().contains(center))
return screen;
if (screen->geometry().intersects(newGeometry))