[Qt-interest] How to save the content in tree structure to file
Oliver.Knoll at comit.ch
Oliver.Knoll at comit.ch
Tue May 4 16:11:03 CEST 2010
Ramesh wrote on Tuesday, May 04, 2010 11:40 AM:
> But in tree hierarchy, I need the key value pairs.. I need to know
> which one is parent and child..
You want to learn about "marshalling/unmarshalling" (aka "serialisation") of data. Read and study a good book about data structures or start here: http://en.wikipedia.org/wiki/Serialization. This is a very generic and basic concept in computer science and has nothing to do with Qt. Qt /does/ provide you the means of implementing that however (such as the mentioned QDataStream, for instance, which takes care of the endianess problem).
This should give you the solution, too: http://stackoverflow.com/questions/337868/want-to-save-binary-tree-to-disk-for-20-questions-game
Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
More information about the Qt-interest-old
mailing list