[Qt-interest] Fwd: QTableView Drag and Drop

Stephen Kelly steveire at gmail.com
Mon Nov 22 11:46:15 CET 2010


Hi Steve,

thanks for reply.

I tried to use the same code with QListView and it works fine without
beginMoveRows/endMoveRows.

In beginMoveRows I should know sourceParent. How could I get sourceParent in
dropMimeData?

As I understand in dropMimeData I should return only true or false depending
on whether the data can be handled by the model. Qt should automatically
remove items from a source calling removeRows if I return true in
dropMimeData.

**

You can find the source parent by using the data structures you have
for the item encoded in the mime data. The moment dropMimeData is
called is 'before' the move.

I'm not sure if returning true or false from dropMimeData makes any
difference, but it certainly shouldn't result in removeRows being
called.



More information about the Qt-interest-old mailing list