[Interest] QTreeView expand/expandAll performance

william.crocker at analog.com william.crocker at analog.com
Fri Sep 26 17:36:54 CEST 2014


On 09/26/2014 09:33 AM, William Hallatt wrote:
> Hi everyone,
>
> I have just started playing with Qt’s MVC classes and have created a
> hierarchical model to display in a QTreeView. Some of the nodes, however, have a
> fair amount of children and when I expand these nodes (or, heaven forbid,
> expandAll), the app hangs for a remarkably long time.
>
> I have read everything I can on lazy model loading and have implemented what I
> believe to be correct fetchMore and canFetchMore methods, yet this does not seem
> to make a difference since fetchMore only gets called once on an expand
> (however, the tree expands to the correct level and to the very last child which
> I find very confusing).
>
> So, my questions are:
>
> 1. Does lazy model loading actually affect the expansion of nodes?
> 2. Is there a way I could improve the performance?
>
> I have been banging my head against this for two days now so any help will be
> appreciated.
>

Are you running with a debug or release build of Qt.

What does a profiler show.

> The code for my item and model classes is available here:
>
> https://www.dropbox.com/sh/8vc1s29wvmvpp07/AAChJVKhjUuXJy9dxjlT6ErRa?dl=0
>
> Thanks!
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>




More information about the Interest mailing list