[Qt-interest] QSortFilterProxyModel Question

Willy P willy.lists at gmail.com
Mon Sep 21 08:18:28 CEST 2009


Thanks Girish.  When I finally stopped trying to re-implement
mapTo/FromSource I got things to work.  One more question, I want top
level items in a tree sorted and everything below them to remain in
their order.  Is that possible?

-Willy

On Sun, Sep 20, 2009 at 11:02 PM,  <anders.bakken at nokia.com> wrote:
> There's a mapToSource function that can be used to get to the original internalId.
>
> Anders
> ________________________________________
> From: qt-interest-bounces at trolltech.com [qt-interest-bounces at trolltech.com] On Behalf Of ext Girish Ramakrishnan [girish at forwardbias.in]
> Sent: Sunday, September 20, 2009 10:06 PM
> To: Willy P; qt-interest at trolltech.com
> Subject: Re: [Qt-interest] QSortFilterProxyModel Question
>
> Hi,
>
> Willy P wrote:
>> Everything works fine b/c I've modified nothing from the parent class.
>>  But I'm noticing that the values for QModelIndex::internalId are
>> crazy.  Is the QSortFilterProxyModel keeping track of data itself?
>
> QSortFilterProxyModel could probably have been designed to keep the same
> internalId as the source model, but the fact is QSortFilterProxyModel
> does not do that :) It maintains a data structure of it's own to keep
> track of nodes in the source model and the internal ids reference that
> data structure.
>
> Girish
> _______________________________________________
> 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