[Qt-interest] Drag and drop model/view questions

Jeremy Sanders jeremy at jeremysanders.net
Sat Jan 30 13:09:05 CET 2010


I've managed to get basic dragging and dropping working in my tree model. I 
have a few questions:

1. If I have CopyAction and MoveAction as supported drop operations, how 
does the user change between moving and copying? Is this documented?

I'd like to having moving by default, but copying only if Ctrl is held down. 
Is this possible?

2. Is it possible to get moving implemented in a single method? As moving is 
done by dropping then deleting, my application sees it as two separate 
operations. This means it shows up as two operations in the undo menu. I'd 
like the user to be able to undo both operations in one go.

The current delete then paste way of moving also means that the naming of 
the items in my tree gets messed up. Each item in my model needs a unique 
name. As a moved item is pasted before deletion, I have to give the item a 
new name to preserve uniqueness, because I don't know a deletion is going to 
occur. This is pretty ugly.

3. Is it possible for drag and drop to check the target is a possible 
destination so that the mouse cursor can be changed? It would be good if the 
user could get immediate feedback that the destination is valid.

Thanks

Jeremy


-- 
Jeremy Sanders <jeremy at jeremysanders.net>




More information about the Qt-interest-old mailing list