Re: treeview/treemodel with 100K's elements



On Tuesday 13 May 2008 7:12:03 pm Jonathon Jongsma wrote:
> On Tue, May 13, 2008 at 9:01 AM, Ionutz Borcoman <iborco gmail com> wrote:
> > Hi,
> >
> >  Playing around with the treemodel, I've discovered that adding a lot of
> > items to the model can become slow, if the number of added items is big
> > enough (>20K on my PC).
> >
> >  So, is there any way to implement a 'lazy' tree model? By lazy I mean:
> >  1. load only the nodes for the items that are currently displayed,
> > without loading their children)
> >  2. add an 'expander' image if the item has children
> >  3. load the children when the node is expanded
> >
> >  An alternative to 2 and 3, if 2 is not possible would be to load only
> > the first children and delay the loading of the remaining children till
> > the node is expanded.
> >
> >  Any ideas or recommendations?
> >
> >  Thanx.
> >
> >  Johnny
>
> you can certainly do this.  I know other people have implemented
> things like this.  You'll probably need to implement a custom
> treemodel.  For number 2, I think what most people do is add a 'dummy'
> child and replace it with the actual children when the row is
> expanded.

Is there any doc on how to write a custom model?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]