PDA

View Full Version : Drag and drop from list/tree widget to graphics view



chaltier
24th March 2012, 13:23
Hi all,

I would like my program to be able to click on an item in a list/tree widget and then drag to graphics view and drop it in..

How do i enable the list/tree widget to allow me to drag the item and drop it into graphics view?

What are the functions i need to implement?

Thanks!

Added after 33 minutes:

My graphics scene is now able to detect drag event from the tree widget item..

but what should I do to let it know which tree widget item is being dragged in?

ChiliPalmer
25th March 2012, 05:15
Hi,

well, that depends. What do you want the Graphics Scene to show? The item text?
Just reimplement http://qt-project.org/doc/qt-4.8/qtreewidget.html#mimeData and transfer the data you need via the mimeData of the Drop