[Qt-interest] Drag & Drop in Item/Views

Egor Popov faraslacks at gmail.com
Mon May 24 02:46:23 CEST 2010


Hi everyone,

I'm trying to use embedded drag/drop functions of item-views classes. I have
Model1 and Model2 derived from QAbstractItemModel. In Model1 there were
implemented:
1. flags() function. It return flags with Qt::ItemIsDragEnabled flag,
2. mimeData() function. It return encoded data in QMimeData structure,
3. mimeTypes() function. It return QStringList with one mimeType,
4. and supportedDragActions() with only Qt::CopyAction in returning values.

Model2 have same functions but it have supportedDropActions instead of
supportedDragActions() in Model1. Returning value is still Qt::CopyAction.
Function flags() always allows drop.

Also I have View1 with dropEnabled == true and dragDropMode == DragDrop and
View2 with same options. acceptDrops also enabled in View2

When I try to drag items from View2 to View1 I see, that drag is started,
but I have not see dropIndicator and dropMimeData() on drop didn't called
too.

What am I doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100524/c6aa2eba/attachment.html 


More information about the Qt-interest-old mailing list