开发者

How to save a file that contains 2 QMap datas in Qt? [duplicate]

This question already has an answer here: 开发者_Python百科 Closed 10 years ago.

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++.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜