Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.8.0
-
None
-
-
f9336a05b (dev), dcea42ea5 (6.8)
Description
When dragging something between two tableview rows, there's a single Y position where instead of dropping there between the items, the drop will react as if it happened on the viewport, which might either append the item to the end, or, in my testcase, just lose the item completely and leave an empty row instead.
This is because of the code in QAIVPrivate::dropOn() which says
if (!index.isValid() || !q->visualRect(index).contains(event->position().toPoint()))
index = root;
In the case of QTableView, there's a one-pixel horizontal line between two cells where indexAt(pos) returns a valid index and visualRect(index) doesn't contain pos, because of the 1 pixel cell border.
The code above is very old (predates public git history) but this probably wasn't detected before because I implemented easier support for moving rows in QTableView/QTableWidget only recently.
Testcase: qtablewidget-dnd.cpp