[Interest] Drag&Drop from QListView to QListView

Igor Mironchik igor.mironchik at gmail.com
Sun Sep 13 13:22:08 CEST 2015


Just want to add some words. If supportedDragActions() returns
Qt::MoveAction only, then rows removed when drag&drop from different
QListView. But in this case drag&drop doesn't work when dragging
internally. I.e. I can't drag item and drop on another place in the same
QListView...

2015-09-13 14:00 GMT+03:00 Igor Mironchik <igor.mironchik at gmail.com>:

> Hi,
>
> Is it possible to set some flags, or something else... that QListView when
> dragged row to another QListView do this drag with Qt::MoveAction?
>
> I have to say that I need handle internal moves too. So in the model I
> have:
>
> Qt::DropActions supportedDragActions() const
>
> {
>
> 	return Qt::MoveAction | Qt::CopyAction;
>
> }
>
>
> Qt::DropActions supportedDropActions() const
>
> {
>
> 	return Qt::MoveAction | Qt::CopyAction;
>
> }
>
>
> And default drop action for this QListViews is Qt::MoveAction, and drag&drop mode is DragDrop.
>
>
> The problem is that while I drag&drop from the same QListView action is Qt::CopyAction. I handle it in dropMimeData(), all is fine. But when I drag&drop from another QListView - data is dropped but row don't removes from that another QListView.
>
>
> How to say QListView when data dropped to another QListView that it should remove dropped data from itself?
>
>
> Thank you.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150913/2419a26e/attachment.html>


More information about the Interest mailing list