PDA

View Full Version : QListView::setSelectionRectVisible(bool)



ouekah
10th May 2010, 14:30
Hi,

could someone explain why the following:



this->sectorsList = new QListWidget;
this->sectorsList->setSortingEnabled(true);
this->sectorsList->setSelectionMode(QAbstractItemView::ExtendedSelect ion);
this->sectorsList->setSelectionRectVisible(false);


doesn't work (i.e. the rectangle is still visible) ?

The documentation says the following:



Note: The selection rectangle will only be visible if the selection mode is in a mode where more than one item can be selected; i.e., it will not draw a selection rectangle if the selection mode is QAbstractItemView::SingleSelection.


The selection mode is QAbstractItemView::ExtendedSelection which is why the rectangle is visible. Does it mean that QListView::setSelectionRectVisible(bool) has no effect ?

ouekah
10th May 2010, 14:34
Is the selection rectangle the rectangle around the QListWidget displayed when one clicks on the widget ?

Lykurg
10th May 2010, 14:56
Are you sure it is the selection rectangle? Isn't it the focus indication?

ouekah
10th May 2010, 15:11
I'm affraid I don't know. Could you explain me what is the selection rectangle and why do we use it for ?