[Qt-interest] Proxy models
Kishore
kitts.mailinglists at gmail.com
Thu Aug 26 10:50:42 CEST 2010
On Tuesday 24 Aug 2010 8:16:29 pm Bo Thorsen wrote:
> 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.
Thats right. I do come from the world of embedded systems and am perhaps just
paranoid! ;)
Well... 10 MB for the whole application does not seem like its too bad
assuming that a much smaller portion of that memory is the result of the
proxy. Besides, embedded systems that Qt targets today are much like
yesterdays supercomputers! 10 MB really is not significant.
As for me and my application... ill just follow and maintain a QMap of
persistent indexes in the proxy! :)
> > 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.
--
Cheers!
Kishore
More information about the Qt-interest-old
mailing list