summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformcursor.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 23:18:39 +0000
commit37a933c2b14a4a1aad54af0eba0bc210ae5b549a (patch)
tree04c4d7f34b23a5e5f3de09adfc900ebf7f700103 /src/gui/kernel/qplatformcursor.cpp
parentd09cfe04b82c1bd0738bca24def1e9c3bfdaaa4b (diff)
QtGui: eradicate Q_FOREACH loops [needing qAsConst()]
... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(). Change-Id: I90fd517ad542ef92034403c15ebb8300a56ac693 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui/kernel/qplatformcursor.cpp')
-rw-r--r--src/gui/kernel/qplatformcursor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/kernel/qplatformcursor.cpp b/src/gui/kernel/qplatformcursor.cpp
index 49881338f2..c644d4769a 100644
--- a/src/gui/kernel/qplatformcursor.cpp
+++ b/src/gui/kernel/qplatformcursor.cpp
@@ -52,9 +52,10 @@ QT_BEGIN_NAMESPACE
QList<QPlatformCursor *> QPlatformCursorPrivate::getInstances()
{
QList<QPlatformCursor *> result;
- foreach (const QScreen *screen, QGuiApplicationPrivate::screen_list)
+ for (const QScreen *screen : qAsConst(QGuiApplicationPrivate::screen_list)) {
if (QPlatformCursor *cursor = screen->handle()->cursor())
result.push_back(cursor);
+ }
return result;
}