diff options
Diffstat (limited to 'src/gui/kernel/qsimpledrag.cpp')
-rw-r--r-- | src/gui/kernel/qsimpledrag.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp index 71cf3f0439..a90e8dd33c 100644 --- a/src/gui/kernel/qsimpledrag.cpp +++ b/src/gui/kernel/qsimpledrag.cpp @@ -34,9 +34,10 @@ Q_LOGGING_CATEGORY(lcDnd, "qt.gui.dnd") static QWindow* topLevelAt(const QPoint &pos) { - QWindowList list = QGuiApplication::topLevelWindows(); - for (int i = list.count()-1; i >= 0; --i) { - QWindow *w = list.at(i); + const QWindowList list = QGuiApplication::topLevelWindows(); + const auto crend = list.crend(); + for (auto it = list.crbegin(); it != crend; ++it) { + QWindow *w = *it; if (w->isVisible() && w->handle() && w->geometry().contains(pos) && !qobject_cast<QShapedPixmapWindow*>(w)) return w; } @@ -309,7 +310,7 @@ static inline QPoint fromNativeGlobalPixels(const QPoint &point) #ifndef QT_NO_HIGHDPISCALING QPoint res = point; if (QHighDpiScaling::isActive()) { - for (const QScreen *s : qAsConst(QGuiApplicationPrivate::screen_list)) { + for (const QScreen *s : std::as_const(QGuiApplicationPrivate::screen_list)) { if (s->handle()->geometry().contains(point)) { res = QHighDpi::fromNativePixels(point, s); break; |