diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-04-14 14:55:44 +0300 |
---|---|---|
committer | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-06-01 09:35:29 +0000 |
commit | a24b90a21c4f2feb61630ca6a1684312556a6bc7 (patch) | |
tree | 1717ed9f699dd5cb119471ccb51f661b7d207f8b /src/gui/kernel/qplatformintegration.cpp | |
parent | d11abc8bd7ac10da4bfd548b3d1d9d4e0dd6a264 (diff) |
Gui: use const (and const APIs) more
For CoW types, prefer const methods to avoid needless detach()ing.
Change-Id: I88d08d499e1be72c1f6d983fecdcee513df18aa2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/gui/kernel/qplatformintegration.cpp')
-rw-r--r-- | src/gui/kernel/qplatformintegration.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index a0e65654a6..3490e786a8 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -474,11 +474,11 @@ void QPlatformIntegration::screenAdded(QPlatformScreen *ps, bool isPrimary) void QPlatformIntegration::removeScreen(QScreen *screen) { - const bool wasPrimary = (!QGuiApplicationPrivate::screen_list.isEmpty() && QGuiApplicationPrivate::screen_list[0] == screen); + const bool wasPrimary = (!QGuiApplicationPrivate::screen_list.isEmpty() && QGuiApplicationPrivate::screen_list.at(0) == screen); QGuiApplicationPrivate::screen_list.removeOne(screen); if (wasPrimary && qGuiApp && !QGuiApplicationPrivate::screen_list.isEmpty()) - emit qGuiApp->primaryScreenChanged(QGuiApplicationPrivate::screen_list[0]); + emit qGuiApp->primaryScreenChanged(QGuiApplicationPrivate::screen_list.at(0)); } /*! |