PDA

View Full Version : QTreeWidget drag/drop



s_a_white
10th February 2007, 21:51
Hi,

Currently I have a QTreeWidget with drag/drag enabled, successfully copying/moving items.

However, this is not fully correct. My QTreeWidgetItems are subclassed (type being indicated in UserRole) and I only want to allows keys of certain types to drop in keys of certain other types.

I've subclassed QTreeWidget and overridden mimeData and dropMimeData to allow me to encode/decode custom information. However with my custom mime format I now get a you cannot do that icon (circle with line through it) when I go to drop it in the desired location.

Where does QTreeWidget decide if a drop can be made on a given it? I did try to override event, looking for QEvent::DropMove but it does not seem to come in there.

Help appreciated,
Simon

jpn
10th February 2007, 22:04
Try reimplementing QWidget::dragMoveEvent().