DnD MetaData

Hi,

It seems that there is no way to associate custom data with a drag n drop except the sourceDescription String.

I would have thought that sourceDescription would be some kind of MIME type and according to this dynamic_cast some kind of meta data.

Did I miss something ?

Thanks,

You can get the orginating component, so I normally just ask that for the data that’s needed.

Well yes but if you want generic stuff you ll need to do some kind of interface
for all component providing the same kind of data.

I ll live with that :slight_smile:
It’s just that I was looking for some mechanism similar to MIME.

Thanks,

i guess if you were really desperate you could use XML data in the string… but since you’re talking of casting anyway, what’s so different about casting the component based on the description string?

More elegant imho.
In my case I m doing a custom TreeView and the dragging part is only handled in the custom TreeViewItem so I might not need to modify the TreeView class.

I’d like to have additional argument “Component *sourceComponent” for isInterestedInDragSource() like other methods because I want to access the data which the source having.

String is not enough to judge whether I need or not. Using XML requires to convert the binary data to XML when start dragging, it will often be hard to do or waste of time, I think.

Best regards,
Masanao Hayashi

good request, I’ll see what I can do.