Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Change icon of a drag and drop event
napajejenunedk0 last edited by
Currently, the only drag and drop place where the icon of a drag action is configurable is when the drag event is "manually created":http://qt-project.org/doc/qt-5/qtwidgets-draganddrop-draggableicons-example.html:
QDrag *drag = new QDrag(this);
drag->setHotSpot(event->pos() - child->pos());
changes the icon of the drag action. But in the case of an externally provoked drag event:
it is not possible to change the icon of the drag action.
I want to drag a file to my application and as the mouse cursor enters the application window's area, I want to change the icon of the drag action. Then if the user doesn't drop the file onto the application window but moves it out of its area, I want to recover the original icon.