Hi friends,

I have a window of configuration of the toolbar on my application, running smoothly the drag n 'drop the items.
I'm using QListWidgetItem with icons, but when you drag the item to another widget, the icon does not go with him. How can I improve this follow code in QMimeData?

Qt Code:
  1. void ListAct::performDrag()
  2. {
  3. QListWidgetItem *item = currentItem();
  4. if (item)
  5. {
  6. QMimeData *mime = new QMimeData;
  7. mime->setText(item->text());
  8.  
  9. QDrag *drag = new QDrag(this);
  10. drag->setMimeData(mime);
  11.  
  12. if (drag->exec(Qt::MoveAction) == Qt::MoveAction)
  13. delete item;
  14. }
  15. }
To copy to clipboard, switch view to plain text mode 

Thanks,

Marcelo E. Geyer
Brazil/RS