Hi,
I have two tree views, side by side and I want to drag one item from one tree into the other. So far I have managed to get something working but my problem is that for the QModelIndex that I drag from Tree A, I want its internal pointer to be available in Tree B.
So far the only way I can see to do it is put the pointer into a QByteArray in
QMimeData *MyModel
::mimeData(const QModelIndexList
&indexes
) const
QMimeData *MyModel::mimeData(const QModelIndexList &indexes) const
To copy to clipboard, switch view to plain text mode
and read it back out in
bool MyModel
::dropMimeData(const QMimeData *data, Qt
::DropAction action,
bool MyModel::dropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent)
To copy to clipboard, switch view to plain text mode
Is this really the best way? Streaming pointers feels wrong.
Thanks
Bookmarks