[Qt-interest] Proxy models

Bo Thorsen bo at fioniasoftware.dk
Tue Aug 24 16:46:29 CEST 2010


Den 23-08-2010 19:52, Kishore skrev:
> I have been working with proxy models lately and am intrigued by their
> complexity.
>
> In short, it seems that most implementations of proxies use a QMap that maps
> beween QPersistantModelIndex's of the source and the proxy. Somehow this seems
> very inefficient o me. Memory consumption would go very high when the number of
> indexes increase. It is not uncommon for say a mail application to have
> several thousands of indexes and maybe 2-3 proxies between the view and the
> actual data.
>
> Is this design really the best way considering speed and memory? I have not
> really seen any other MVC classes for comparison...

I was involved in a project some years ago, where we had a table model 
with a sort filter proxy doing both filtering and sorting. The table had 
around 8 columns and sometimes had several thousand rows - I tested it 
with 40.000 rows at one point. With this, the application ran at about 
10 MB memory on Windows.

I doubt the memory consumption is a problem on anything but embedded 
systems.

> I am getting more and more interested in this and am curious to see some other
> MVC architectures! :)

The model view classes in Qt are indeed quite complex. But they are 
worth the effort. A well written model in Qt just keeps working and is 
very easy to maintain and expand upon.

Bo.

-- 

Bo Thorsen, Fionia Software
Expert Qt and C++ developer for hire
Mail me if you need a hand with your Qt code



More information about the Qt-interest-old mailing list