PDA

View Full Version : Saving A List



BatteryCell
25th May 2007, 00:25
Hello, I have written a program which gets song info from a server and stores it in a QTreeWidget. Every artist gets a node, with children that are albums. Then under each album I have the titles. So "My December" by Linkin Park would look like:


+---Linkin Park
|
+---Reanimation
|
+---My December


However, looking up this list takes a lot of time and the list almost never changes. So, I would like to be able to save the data in a way that would allow me to create the widget much faster. Does anyone know how to save something like this to a file in such a way that it would be easily accessible?

wysota
25th May 2007, 00:46
XML would be a good choice.

BatteryCell
25th May 2007, 01:06
lol me and xml do not get along, however I figured out how to do it; I just go through all top level widgets and recur through their children. As I recur I print the nodes data (and depth), then its children's data, and so on.

Thanks for the suggestion though :)