File Tree Component as Drag and Drop Source


#1

I use a FileTreeComponent as a Drag and Drop Source.

I set up the DragAndDropDescription : fileTree->setDragAndDropDescription(“DnDFile”)

So my DragAndDropTarget gets always the same Description “DnDFile” and the Component* ItemComponent.

Whats the best way to get the filename behind the ItemComponent?

There should be a File FileTreeComponent::getItemFile(Component* ItemComponent) or the name of the File should be in the DragAndDropDescription

any idea?


#2

From the component, you can find the treeview, and then you can ask the treeview for all its selected items, as those are what is being dragged.


#3

thanks, i found another point:
When selecting muliple Files, and you drag the files, only the one (which where the mouse is) will be painted as drag-image.