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

Dario Ahdoot dario.ahdoot at image-metrics.com
Fri Mar 13 17:22:55 CET 2009


I understand what you are saying, however, my point is that the *view* should "draw" the row as selected even though only one index in the selection model is selected since the style of the view is to have the whole row selected.

-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Andreas Pakulat
Sent: Friday, March 13, 2009 6:53 AM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Creating a QModelIndex outside of a QAbstractItemModel subclass

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.
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list