From 7d9fa5e4f96840321ff996b4c637b7cd686c3570 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Thu, 7 Jan 2021 21:46:58 +0100 Subject: Fix drop below collapsed separator. --- src/modlistview.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/modlistview.cpp') diff --git a/src/modlistview.cpp b/src/modlistview.cpp index ec31d4dc..91d522a6 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -1295,10 +1295,18 @@ void ModListView::dragMoveEvent(QDragMoveEvent* event) void ModListView::dropEvent(QDropEvent* event) { + // from Qt source + QModelIndex index; + if (viewport()->rect().contains(event->pos())) { + index = indexAt(event->pos()); + if (!index.isValid() || !visualRect(index).contains(event->pos())) + index = QModelIndex(); + } + // this event is used by the byPriorityProxy to know if allow // dropping mod between a separator and its first mod (there // is no way to deduce this except using dropIndicatorPosition()) - emit dropEntered(event->mimeData(), static_cast(dropIndicatorPosition())); + emit dropEntered(event->mimeData(), isExpanded(index), static_cast(dropIndicatorPosition())); // see selectedIndexes() m_inDragMoveEvent = true; -- cgit v1.3.1