Commit 38968494 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

[Qt] Add an icon when dragging.

This improves the user experience.
parent da3ae9e4
...@@ -329,8 +329,9 @@ void WidgetListing::startDrag( Qt::DropActions /*supportedActions*/ ) ...@@ -329,8 +329,9 @@ void WidgetListing::startDrag( Qt::DropActions /*supportedActions*/ )
QDrag *drag = new QDrag( this ); QDrag *drag = new QDrag( this );
drag->setMimeData( mimeData ); drag->setMimeData( mimeData );
// drag->setHotSpot(QPoint(pixmap.width()/2, pixmap.height()/2)); QPixmap aPixmap = item->icon().pixmap( QSize( 22, 22 ) );
drag->setPixmap( aPixmap );
drag->setHotSpot( QPoint( 20, 20 ) );
drag->exec(Qt::CopyAction | Qt::MoveAction ); drag->exec(Qt::CopyAction | Qt::MoveAction );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment