Dragging copies

OK, short and sweet: I want to drag a
copy
from a tree or table to another component. That is, when I drop the dragged object, I do
not
want the original deleted from the source tree or table. I want to be able to drag multiple copies.

How do I do this?

TIA

Probably you already found the answer, but there is nothing special about this - when an item is dropped, simply create a new item with the data and do not remove the item from the source container. Some examples you have probably seen (like
this one
) explicitly remove the item from the source container.

For copying a subtree from a tree, a few more lines of code are needed.

That is exactly what I expected, but somehow I missed that line repeatedly. This time, with your prompting, I must have been more careful, because I found it:

sourceContainer.removeItem(sourceItemId);

Hope that saves someone else the hassle.

Thanks much for your response!

(BTW, if I’d have found the answer on my own, I’d have come back and posted it. There are few things more frustrating than finding that someone else had your same problem, apparently solved it, and then never posted the solution. I try hard not to make that error.)

Chas.