PDA

View Full Version : QTreeView and expanding items just added



googie
23rd April 2013, 01:09
Hi,

I'm facing similar case as in http://www.qtcentre.org/threads/26013-Restore-QTreeView-expanding

The problem is that I restore model items and while I'm doing that I want to also apply expanding info to nodes. Unfortunately it looks like QTreeView hasn't "updated" it's rendering for items, therefore my calls to "tree->expand(item->index())" don't work.

What I'm doing is adding items, then adding childs to items and then applying expand() to certain top level items. It's all done in the same method, so I guess this is the issue here.

I think I can extend QTreeView to implement support for my custom items that have "expanded" flag and render it accordingly. I just don't know how to make it the simplest way. How would that be?

Regards,
Pawel

wysota
23rd April 2013, 07:39
Please provide a minimal compilable example reproducing the problem.