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. So this code (whose origin predates public git history) would turn the valid index into the root index, leading to an unexpected append instead of insert. The only other case I could find where this condition happened was when dropping onto the branches of a QTreeView, but even there it seems much more expected to drop on the item (or between items) than on the viewport (which often means append at the very bottom, far from the drop area). Change-Id: Ia7c884d3fc925a7536ea3ab75851366c531d8438 Fixes: QTBUG-130045 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit f9336a05bccaf8d287f949e3263e07f2e437835c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%