[Qt-interest] parse items of QTreeWidget into file/QSettings

Ross Driedger ross at earz.ca
Sun Nov 8 05:12:59 CET 2009


Second try at sending this.

On Sat, 07 Nov 2009 21:18:46 -0500, <qt-interest-request at trolltech.com>  
wrote:

> Message: 2
> Date: Sat, 7 Nov 2009 23:49:03 +0200
> From: Mystical Groovy <mysticalgr at gmail.com>
> Subject: Re: [Qt-interest] parse items of QTreeWidget into
> 	
> To: Andr? Somers <andre at familiesomers.nl>
> Cc: qt-interest at trolltech.com
> Message-ID:
> 	<4877b36e0911071349j140b502ftaac49ac20bb73e78 at mail.gmail.com>
> Content-Type: text/plain; charset="windows-1252"
> Oh god Thank you all for your replies again but I dont seem to find a  
> way to
> manage this, I can access the model() of QTreeWidget thats for sure, but
> then how can i parse the contents of it?(!!)

This is pretty elementary computer science stuff.

> I'm thinking that maybe its possible if somehow read the rows in  
> QtreeWidget
> one by one, and for each row I get the item's text.

If you have access to a tree item, you can:
for each tree item you have selected
1) write the data to the file,
2) find the item's children
3) for each child, repeat the above two steps.

> Mind if you share some sample code?

I'm of mixed mind on this.  While it might help you for the immediate  
time, figuring it out how to do it (with some help) is the best way to  
learn.  I think I speak for many of the programmers here when I say that  
we had to do seemingly countless exercises in school on subjects like this  
-- and we became better programmers for it.

You have been given a good number of helpful clues by several posters to  
the list.

-- 
"Without music to decorate it, time is just a bunch of boring production  
deadlines or dates by which bills must be paid."
Frank Zappa

Ross Driedger
ross_at_earz.ca



More information about the Qt-interest-old mailing list