[Qt-interest] Creating a QModelIndex outside of a QAbstractItemModel subclass

Andreas Pakulat apaku at gmx.de
Thu Mar 12 17:09:08 CET 2009


On 12.03.09 10:36:05, Dario Ahdoot wrote:
> Thanks. I somehow missed that method on QAbstractItemModel.
> 
> On a related note, based on the code snippet below, would you consider it a bug that if you have a tree with a SelectionBehavior of QAbstractItemView::SelectRows, then when you call select on it, then it should select the whole row of the model index you pass in?

So you mean it doesn't select the whole row, right? Thats actually correct,
because you're selecting something in the selection model, not the view.
The selection behaviour is private to the view and only drives what the
user can select. For example its perfectly possible to have the same
selection model in two different views and one only allows to select full
rows, while the other allows to select single items (no I don't have a real
world use-case at hand right now).

Andreas

-- 
A few hours grace before the madness begins again.



More information about the Qt-interest-old mailing list