diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-01-26 14:38:54 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-04-25 07:42:48 +0000 |
commit | 0d19a571cd5d5b031a91a4a3b4ad0a380989c47a (patch) | |
tree | 903092aa34df728c0b4d2397f33604ed2460c735 /src/plugins/platforms/android/androidjnimain.cpp | |
parent | 3010c387132a54f81147d5b2c17d96b27f49fe0f (diff) |
Android: 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: Ia086b1f3d072dd56c3545780490be03346df2880
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/plugins/platforms/android/androidjnimain.cpp')
-rw-r--r-- | src/plugins/platforms/android/androidjnimain.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index 3847f55d3a..52f34166eb 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -627,7 +627,8 @@ static void updateWindow(JNIEnv */*env*/, jobject /*thiz*/) return; if (QGuiApplication::instance() != nullptr) { - foreach (QWindow *w, QGuiApplication::topLevelWindows()) { + const auto tlw = QGuiApplication::topLevelWindows(); + for (QWindow *w : tlw) { QRect availableGeometry = w->screen()->availableGeometry(); if (w->geometry().width() > 0 && w->geometry().height() > 0 && availableGeometry.width() > 0 && availableGeometry.height() > 0) QWindowSystemInterface::handleExposeEvent(w, QRegion(QRect(QPoint(), w->geometry().size()))); |