I want to implement drag and drop on my QListView, so I would like to get the selected item delegate. How can I do that?
I haven't tested this for myself, but this is what I found out by reading the documentation.
QListView
has a QList<QModelIndex>
which contains the selected items. You can access this list using QListView::selectedIndexes()
.
Then you can call QAbstractItemView::itemDelegate( const QModelIndex& index )
for your selected index. This function returns a QAbstractItemDelegate*
.