Important: Please read the Qt Code of Conduct -

Custom pixmap and dynamic cursor while dragging item from QListView

  • How can I achieve these 2 things while dragging an item from QListView:

    1. I'd like to use custom pixmap instead of provided by default (which is just a copy of my item)
    2. Also I'd like to change cursor with one of my own, depending on possibility of underlying area to accept dragged item.

  • Hi,

    In order to use custom pixmap while dragging you can have a look in "QDrag::setPixmap()": You can write something like

    @QDrag *drag = new QDrag(this);

    in startDrag() event or mousePressEvent() whichever you are using.

Log in to reply