Hello,
I get a little bit confused with the way selection behaviour in MVC views should be handled. More more precisely there are 2 places where selection behaviour can be described:

1) I put these lines in the constructor of my view:
this->setSelectionBehavior(QAbstractItemView::SelectRow s);
this->setSelectionMode(QAbstractItemView::ExtendedSelec tion);
2) In response to some event I put these lines in a mouseReleaseEvent() function
QItemSelectionModel::SelectionFlags flags(QItemSelectionModel::Rows | QItemSelectionModel::SelectCurrent);
if (!this->ctrl_key)
flags |= QItemSelectionModel::Clear;
this->setSelection(r, flags);
and of course in the setSelection() method, I put:
this->selectionModel()->select(sel, flags);
where sel is a QItemSelection.

I would expect either 1) or 2) be enough for the extended selection behaviour to work, that is clicking on an item while handling the control key (in this case this->ctrl_key == 1) should select a new item while keeping the already selected ones selected. But even with both codes it does not work!
So my questions are:
- which mistake(s) in my code?
- should I use 1) and/or 2) for the extended selection behaviour to work?
Thanks in advance for your help.

Caius

PS: I use Qt4.1