diff options
Diffstat (limited to 'src/gui/kernel/qsimpledrag.cpp')
-rw-r--r-- | src/gui/kernel/qsimpledrag.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp index 77cbfd2b96..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.size()-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; } |