Hi all,
When you drag and drop from a QListView or QTreeView you have the cursor + the icon or the row of the tree.
Is it possible to hide and only keep the cursor when the drag and drop is in a QWidget ?
Thanks for the help
Printable View
Hi all,
When you drag and drop from a QListView or QTreeView you have the cursor + the icon or the row of the tree.
Is it possible to hide and only keep the cursor when the drag and drop is in a QWidget ?
Thanks for the help
Does QDrag::setPixmap() with an empty QPixmap do it?
Thanks, that works using this code :
Is it possible to only hide the pixmap when it's outside of the QListView ?Code:
{ public: { } protected: virtual void startDrag( Qt::DropActions supportedActions ) { const QModelIndexList indexes = selectedIndexes(); Drag.setMimeData( model()->mimeData( indexes ) ); Drag.exec( supportedActions ); } };
Maybe "dragLeaveEvent ( QDragLeaveEvent * e )" is a way to think about but then "QDrag Drag( this );" has to be stored ?
But still the problem of "m_DetailList->setViewMode( QListView::IconMode );".
It's impossible to drag and drop internaly using QListView with IconMode.
Using "QListView::ListMode" that works normally.
I hope you know the solution.
EDIT : Apparently it's because "m_DetailList->setMovement( QListView::Static );"
But without it, you can move items that is not good for what I do, does a way exist to just allow drag and drop but not move ?
Thanks
EDIT2 : Here the solution of the Static problem :
I do all that under your control, say me if what I do is not correct.Code:
{ if( indexAt( e->pos() ).isValid() ) else e->ignore(); }