Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing multiple selection mode for QListView

Tags:

qt

In QListView, i'd like to disable mouse drag multiple selection - that is, mous down on a row, drag the mouse down and select the rows below it while dragging.

I'd still like row selection using CTRL-mouse click.

Is that possible?

like image 402
JasonGenX Avatar asked Nov 18 '11 20:11

JasonGenX


Video Answer


1 Answers

It seems you've set the list view's selection mode to QAbstractItemView::MultiSelection. Try setting it to QAbstractItemView::ExtendedSelection with:

listView->setSelectionMode( QAbstractItemView::ExtendedSelection );

and see if that helps.

like image 88
JediLlama Avatar answered Sep 22 '22 18:09

JediLlama