I believe the reason you can drag an item up but not down in the
ListView is because the item being dragged is interfering with the
dataView.indexAt(mouseX, mouseY). It appears that the items in the
ListView are searched in order. Since the drag item moves with the
mouse, it is always under the mouse and always the first item found
since it precedes later items which might also be under the mouse.

One solution to this problem is to move the drag target imperceptibly
in x and only use y for indexAt. For example, add "currentItem.x =
0.001" to onPressed, and change "var tempIndex =
dataView.indexAt(mouseX, mouseY)" to "var tempIndex =
dataView.indexAt(0, mouseY)"

I've seen other drag reordering of ListView solutions, but they
usually move the item being dragged, and thus don't have the same
problem with use of indexAt.

  Bradley
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to