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

Qt-interest Archive, July 2007
QSortFilterProxyModel takes very long for filtering


Message 1 in thread

Hello !

I have the following problem with QSortFilterProxyModel:

I use a QStandardItemModel with 18 columns and use QSortFilterProxyModel
for search operations, displayed via QTableView.

If I have only 300 rows in the QStandardItemModel, it works fine and
very fast, but my QStandardItemModel has 30000 - 40000 rows, where I
like to perfom this search operations (only one column is used for
searching) and it slows down very and the applications seems to be frozen.


Is there a way to speed up the filtering operations or is there a trick ?



Thanks a lot for helping !


Heiko Steindl

--
 [ signature omitted ] 

Message 2 in thread

QStandardItemModel is slow when dealing with large amounts of data. If 
your data is represented as a table of data (index to a data item is 
given via row and column), then you want to subclass 
QAbstractTableModel. QAbstractTableModel is just an interface that 
allows you to use Qt's view objects so underneath, as a member object, 
you will need some data structure (vector of vectors?).

chris burke
phone: 617-621-0060 x195
email: cburke@xxxxxxx
skype: chris.burke0



Heiko Steindl wrote:
> Hello !
>
> I have the following problem with QSortFilterProxyModel:
>
> I use a QStandardItemModel with 18 columns and use QSortFilterProxyModel
> for search operations, displayed via QTableView.
>
> If I have only 300 rows in the QStandardItemModel, it works fine and
> very fast, but my QStandardItemModel has 30000 - 40000 rows, where I
> like to perfom this search operations (only one column is used for
> searching) and it slows down very and the applications seems to be frozen.
>
>
> Is there a way to speed up the filtering operations or is there a trick ?
>
>
>
> Thanks a lot for helping !
>
>
> Heiko Steindl
>
> --
> 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 ] 

Message 3 in thread

Thanks a lot !

I'll look at it !

Currently I disabled QTableView::resizeColumnsToContents() and only
allow searching, if the search name is longer than three char's.

With this limitation it works _very_ fast ;-)

Thanks a lot  for helping !

Heiko

Chris Burke schrieb:
> QStandardItemModel is slow when dealing with large amounts of data. If
> your data is represented as a table of data (index to a data item is
> given via row and column), then you want to subclass
> QAbstractTableModel. QAbstractTableModel is just an interface that
> allows you to use Qt's view objects so underneath, as a member object,
> you will need some data structure (vector of vectors?).
>
> chris burke
> phone: 617-621-0060 x195
> email: cburke@xxxxxxx
> skype: chris.burke0
>
>
>
> Heiko Steindl wrote:
>> Hello !
>>
>> I have the following problem with QSortFilterProxyModel:
>>
>> I use a QStandardItemModel with 18 columns and use QSortFilterProxyModel
>> for search operations, displayed via QTableView.
>>
>> If I have only 300 rows in the QStandardItemModel, it works fine and
>> very fast, but my QStandardItemModel has 30000 - 40000 rows, where I
>> like to perfom this search operations (only one column is used for
>> searching) and it slows down very and the applications seems to be
>> frozen.
>>
>>
>> Is there a way to speed up the filtering operations or is there a
>> trick ?
>>
>>
>>
>> Thanks a lot for helping !
>>
>>
>> Heiko Steindl
>>
>> -- 
>> 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/
>>   
>
> -- 
> 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 ] 

Message 4 in thread

On Thursday 19 July 2007 15:29:34 Heiko Steindl wrote:
> Hello !
>
> I have the following problem with QSortFilterProxyModel:
>
> I use a QStandardItemModel with 18 columns and use QSortFilterProxyModel
> for search operations, displayed via QTableView.
>
> If I have only 300 rows in the QStandardItemModel, it works fine and
> very fast, but my QStandardItemModel has 30000 - 40000 rows, where I
> like to perfom this search operations (only one column is used for
> searching) and it slows down very and the applications seems to be frozen.
>
> Is there a way to speed up the filtering operations or is there a trick ?

I would recommend profiling your application to see where the problem is 
first.  Only then can you make changes with the knowledge of what is causing 
the problem and what you might be able to do to fix it.

-Benjamin Meyer

--
 [ signature omitted ]