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 77cbfd2b96..bff1ad482b 100644 --- a/src/gui/kernel/qsimpledrag.cpp +++ b/src/gui/kernel/qsimpledrag.cpp @@ -30,13 +30,14 @@ QT_BEGIN_NAMESPACE -Q_LOGGING_CATEGORY(lcDnd, "qt.gui.dnd") +Q_STATIC_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; } |