Hi,
I have started to implement a drag n drop operation from QListWidget to QTreeWidget. I have implemented the drag operation but it is not working. Here is my code.
Qt Code:
{ if(event->buttons() & Qt::LeftButton){ startPos = event->pos(); } } { if(event->buttons() & Qt::LeftButton){ int xDiff = startPos.x() - event->pos().x(); if(xDiff > 3 ){//drag only if the movement is towards left startDrag(); } } } void NameListWidget::startDrag() { if(item){ mimeData->setText(item->text()); drag->setMimeData(mimeData); drag->pixmap().height())); drag->start(); } }To copy to clipboard, switch view to plain text mode
When I start dragging the pixmap does not appear. Can someone please tell what can be the problem ?
Thanks a lot.
Bookmarks