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

Andreas Pakulat apaku at gmx.de
Fri Mar 13 14:52:50 CET 2009


On 12.03.09 13:18:20, Dario Ahdoot wrote:
> Yes, it doesn't select the whole row. However, if a view's style is select the whole row, then selecting an index through the selection model of the view should be identical to selecting that index through the UI itself, no? i.e. the whole row of the index should be selected, I would think.
> 
> If you select an item in a tree view where the selection behavior is to select the whole row when you click on an item (or select it programmatically), it is weird to see the existing behavior, both from a coders and UI point of view.

IMHO its not weird. See the selection model of a given view is just another
model. It doesn't know _anything_ about the view its attached to, hence it
cannot know that selecting an item in a certain row should be selecting all
items in that row.

Think about what happens if you have multiple views with the same selection
model, which view should "force its" selection behaviour on the selection
model? And why should this then also force the other view into the same
selection behaviour?

Andreas

-- 
Today is the first day of the rest of the mess.



More information about the Qt-interest-old mailing list