diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-06-19 15:09:33 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-06-22 13:10:54 +0000 |
commit | 6173e1d6f82b3bc205c1bebdc8481c1dbff4572f (patch) | |
tree | c384626aec1c786aede1ddf2a882e46fc2d494e6 /src/plugins/platforms/windows/qwindowsscreen.cpp | |
parent | 033a1a279311fd2eda02e4c90657542f688b5f8b (diff) |
Build the Windows platform plugin with QT_NO_FOREACH
...for consistency with the other platform plugins.
Change-Id: I85946d610a62c19140618c83f80c4aa63fce4bc3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsscreen.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsscreen.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index f2d32bc9b4..bf7f359aac 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -274,9 +274,12 @@ QList<QPlatformScreen *> QWindowsScreen::virtualSiblings() const { QList<QPlatformScreen *> result; if (m_data.flags & QWindowsScreenData::VirtualDesktop) { - foreach (QWindowsScreen *screen, QWindowsContext::instance()->screenManager().screens()) + const QWindowsScreenManager::WindowsScreenList screens + = QWindowsContext::instance()->screenManager().screens(); + for (QWindowsScreen *screen : screens) { if (screen->data().flags & QWindowsScreenData::VirtualDesktop) result.push_back(screen); + } } else { result.push_back(const_cast<QWindowsScreen *>(this)); } @@ -505,7 +508,8 @@ void QWindowsScreenManager::removeScreen(int index) // move those manually. if (screen != primaryScreen) { unsigned movedWindowCount = 0; - foreach (QWindow *w, QGuiApplication::topLevelWindows()) { + const QWindowList tlws = QGuiApplication::topLevelWindows(); + for (QWindow *w : tlws) { if (w->screen() == screen && w->handle() && w->type() != Qt::Desktop) { if (w->isVisible() && w->windowState() != Qt::WindowMinimized && (QWindowsWindow::baseWindowOf(w)->exStyle() & WS_EX_TOOLWINDOW)) { @@ -530,9 +534,9 @@ void QWindowsScreenManager::removeScreen(int index) bool QWindowsScreenManager::handleScreenChanges() { // Look for changed monitors, add new ones - WindowsScreenDataList newDataList = monitorData(); + const WindowsScreenDataList newDataList = monitorData(); const bool lockScreen = newDataList.size() == 1 && (newDataList.front().flags & QWindowsScreenData::LockScreen); - foreach (const QWindowsScreenData &newData, newDataList) { + for (const QWindowsScreenData &newData : newDataList) { const int existingIndex = indexOfMonitor(m_screens, newData.name); if (existingIndex != -1) { m_screens.at(existingIndex)->handleChanges(newData); @@ -564,7 +568,7 @@ void QWindowsScreenManager::clearScreens() const QWindowsScreen *QWindowsScreenManager::screenAtDp(const QPoint &p) const { - foreach (QWindowsScreen *scr, m_screens) { + for (QWindowsScreen *scr : m_screens) { if (scr->geometry().contains(p)) return scr; } |