Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, March 2007
filter model problem


Message 1 in thread

Hi,

I use a QSortFilterProxyModel for filtering a custom table model. I'd
like to filter by all columns. According to the docs, if I set the
filterKeyColumn property to -1, "the keys will be read from all columns".

Well, when I use -1, the filter doesn't filter at all; however, using a
specific column works (btw, I filter using #setFilterFixedString). Any
idea what I might be doing wrong?

Thanks,
M

--
 [ signature omitted ] 

Message 2 in thread

> I use a QSortFilterProxyModel for filtering a custom table model. I'd
> like to filter by all columns. According to the docs, if I set the
> filterKeyColumn property to -1, "the keys will be read from all
columns".
> 
> Well, when I use -1, the filter doesn't filter at all; however, using
a
> specific column works (btw, I filter using #setFilterFixedString). Any
> idea what I might be doing wrong?

just an idea: 
you're thinking that if any of the keys say "reject", the model should
filter this entry out. (but this doesn't work)
it seems the class is working the other way round: if any of the keys
say "accept", the model will include this entry into the result.

Peter

--
 [ signature omitted ] 

Message 3 in thread

Peter Prade wrote:
>> I use a QSortFilterProxyModel for filtering a custom table model. I'd
>> like to filter by all columns. According to the docs, if I set the
>> filterKeyColumn property to -1, "the keys will be read from all
> columns".
>> Well, when I use -1, the filter doesn't filter at all; however, using
> a
>> specific column works (btw, I filter using #setFilterFixedString). Any
>> idea what I might be doing wrong?
> 
> just an idea: 
> you're thinking that if any of the keys say "reject", the model should
> filter this entry out. (but this doesn't work)
> it seems the class is working the other way round: if any of the keys
> say "accept", the model will include this entry into the result.
> 
> Peter

Aah, that might be the case indeed. Thanks for clarifying :)

I guess I cannot archive what I want (filter-accept if *any* column
matches the filter expression) without subclassing
QSortFilterProxyModel, can I?

M


> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ]