diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-07 21:46:58 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-10 10:27:30 +0100 |
| commit | 7d9fa5e4f96840321ff996b4c637b7cd686c3570 (patch) | |
| tree | d078e7264f80edafe0e05360edaa3fb6d79a990f /src/modlistview.cpp | |
| parent | fc60ea5b7a023493375a6fced6572156f48e36c3 (diff) | |
Fix drop below collapsed separator.
Diffstat (limited to 'src/modlistview.cpp')
| -rw-r--r-- | src/modlistview.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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<DropPosition>(dropIndicatorPosition()));
+ emit dropEntered(event->mimeData(), isExpanded(index), static_cast<DropPosition>(dropIndicatorPosition()));
// see selectedIndexes()
m_inDragMoveEvent = true;
|
