Drag drop signal for two QListViewWidgets
-
Hi, i have two QlistViewWidgets by setting :
@
list1->setDragDropMode(QAbstractItemView::DragDrop);
list1->setDefaultDropAction(Qt::MoveAction);
list2->setDragDropMode(QAbstractItemView::DragDrop);
list2->setDefaultDropAction(Qt::MoveAction);
@
i am able to drag and drop items between both list views what i need now is a signal and slot to show when the items have been dragged and drop - preferably with their index / text.is there any way to do this ?
Cheers, Tim.
-
Hi,
I would subclass and reimplement the startDrag and dropEvent functions for example
Hope it helps
-
Cheers for the direction SGalst.
i manged to get hold of the dropEvent and dragMoveEvent using this code:
@
listWidget::listWidget(QWidget *parent)
: QListWidget(parent)
{
setDragDropMode(QAbstractItemView::DragDrop);
setDefaultDropAction(Qt::MoveAction);
}void listWidget::dropEvent(QDropEvent *event)
{
QListWidget::dropEvent(event);
}void listWidget::dragMoveEvent(QDragMoveEvent *e)
{QListWidget::dragMoveEvent(e);
}
@
but im kind of clueless of what to do from here. i need to be able to get the statustip of the item moved.
any way to do this?
-
What do you mean by statustip ?
-
ill take a print screen which will hopefully make more sense
-
If you are using a QFileSystemModel underneath and IIRC you should just have to make it writable and all this should be handled for you.