Hi, all,
I'm building an application using QAbstractItemModel for custom types of
items in a QListView and in a QTreeView. Those items have to be
dragged/dropped inside the QTreeView – both copy and move – and dragged
from the QListView and dropped to the QTreeView.
Although much of the functionality is already working, on the tree model
class, in the “dropMimeData” method, I don't get the “row” and “column” the
data was dropped to, they always come as -1. Also, the “parent” comes as
the header item.
I know the problem is that I have derived QAbstractItemModel for a model
view of a QTreeView and also derived the QTreeView, adding my own mouse
event handlers to generate a QDrag object, carrying the needed information
to move/create new items in the QTreeView, and it only started to work when
I switched to “application/x-qabstractitemmodeldatalist” mime type,
encoding and decoding my data to it.
Although many sample code found here and there suggests that this mime type
would also carry a location, I also could not manage to recover it, as far
as I did not encoded it at first, but I don't think this is what I am
looking for.
Thanks
Francisco
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest