summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformwindow.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-01-26 14:38:54 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-02-11 19:25:47 +0000
commitbcd7d223f066f2830501c2be79f1e7e4f6dd8f50 (patch)
tree2731bb0009263cb2c8d6365a0fedaf2ae63ab8db /src/gui/kernel/qplatformwindow.cpp
parent276d6cf239bdb0a39ae589e13f60b2a31a2efb60 (diff)
QtGui: eradicate Q_FOREACH loops [rvalues]
... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Change-Id: I457942159015ff153bdfc6d5f031a3f0a0f6e9ac Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
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))