Possible Duplicate:
Serialization with Qt
I have 2 datas which type is QMap:
1.QMap novel; QString tempChapter; QString tempStory;
2.QMap combo; int tempInd; QString tempChap;
my question is: How can I save these 2 Datas into a single file?? And if it's successfully saved, how can I load these 2 datas? Please insert the code too because I'm a beginner C++ programmer and dont know much about OOP,, please answer this ASAP! Thank you very much! :)
All of the basic collections in qt are supported by QDataStream check for support in the QMap docs, as you are only storing other basic qt types and ints you should be ok
Basically, you will have to think of a format to store your data in yourself. I would suggest to read something about serialization. Read this for some general information about serialization in C++.
精彩评论