QTreeWidget/QTreeWiew drag & drop
-
Hello. I am working with my project and got I problem.
When I use drag and drop from QTreeWidget/QTreeView there is an item with the mouse cursor.
Is there any way to remove this item block?
!http://i50.tinypic.com/2mnj2tx.png()! -
It is actually the "QDrag::pixmap()":http://doc.qt.nokia.com/4.7-snapshot/qdrag.html#pixmap . You can change the pixmap using "QDrag::setPixmap":http://doc.qt.nokia.com/4.7-snapshot/qdrag.html#setPixmap
You can write something like
@QDrag *drag = new QDrag(this);
drag->setMimeData(/mimeData/);
drag->setHotSpot(/location/);
drag->setPixmap(/pixmap/));@in startDrag() event or mousePressEvent() whichever you are using.