views:

242

answers:

1

Hi everyone,

I'm facing a pretty strange problem and I need some help from your brains :)

1) I'm using Qt 4.6.0
2) I want to enable drag&drop (Qt::MoveAction with QAbstractItemView::InternalMove only) on items in a treeview.
3) I have my own model and a proxy model used to perform some sorting...
4) Drag&Drop works well except for one single thing, here it is :

When I perform some "real quick" drag&drops in the tree (basically throwing items from a parent to another) or when I'm trying to throw an item out of the three (above the first parent, between the top parent and the treeview's viewport's limit), the moving item disappears... Even worse, sometimes, a corrupted item is created above my first folder (See the following pictures).

Image Before
Image After

Let's try and summarize a bit : When I perform quick and random moves with the items in the tree(changing their parents or re-placing the items in their current parent), sometimes I have items that go everywhere but where they should... I also remind you guys that when used "normally" my drag&drop works...

I hope I've been clear enough, don't hesitate to ask for further details !

Thanks in advance for your help !!

A: 

I've been having the same problem, and it seems to be because you can drop an item onto another item, and then replace that item. I haven't figured out how to solve this problem though.

Marius
Andy M
If you turn on the dropIndicator, then you can see it (at least in the new qt). The item you drop on gets either a black bar at the top or bottom (indicating that you drop it between two items) or it gets a black border around it (indicating that it will replace it). I haven't found how to turn it off though.
Marius