|
|
Marian,
I have also done this in some of my projects. The best I can offer is to
insert a "placeholder" node for each unopened node. Connect the expanded()
signal of your view to a slot in your model to remove the "placeholder"
and insert all the appropriate elements under that node.
To get a little fancier (and prevent every possible node from being
expandable), only insert a placeholder if there is at least one node under
that node. That way it's only marked as expandable if there is actual data
there.
Unfortunately, there is not yet a method of doing this the "right way".
The best I've found so far is the above ugly hack.
--
Life without passion is death in disguise
On Mon, March 20, 2006 9:21 am, Marian Popeanga wrote:
>
> Hello guys,
>
>
> I wasn't able to find out a solution for the following problem:
>
> I want to implement a large Tree Model. In order to do this in an
> efficient way, i need to populate child items only when the user tryes to
> expand their parent items. Initialy the model wil have only high
> level items.
>
> Any ideas are highly apreciated.
>
> Thanks,
> Marian
>
> --
> 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/
|
|