[Qt-interest] Qt-based Tree container?

Arnold Krille arnold at arnoldarts.de
Tue Oct 27 14:29:45 CET 2009


On Tuesday 27 October 2009 11:15:51 Andre Somers wrote:
> With the talks about model/view programming still in my mind, and the
> remarks on how you should not use a model to actually store the
> information but only provide an interface to it comming back to memory,
> I wanted to refactor a model I have done in an application I am working on.
> I find myself needing a generic tree implementation, and I realize that
> that is something I have been strugling with before when trying to
> implement tree models: trees are hard to get right...
> Looking through the Qt container classes, I was wondering why there
> isn't a QTree container class to store n-ary trees in a good way. I
> think that would be very useful to have in the toolkit. What do other
> people here use if they need to keep data in memory in a tree structure?
> Is there some Qt-ish generic implementation around I could use? Should
> it be added to the Qt container classes?

There is a Qt tree object, its called QObject :-)

My QTreeItem at 
https://svn.fzd.de/trac/epos/browser/trunk/epos/libcore/qtreeitem.h just 
extends that a little...
I also have a model to provide a tree-view on that trees: 
https://svn.fzd.de/trac/epos/browser/trunk/epos/libcore/qtreeitemmodel.h

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091027/2293fe0d/attachment.bin 


More information about the Qt-interest-old mailing list