PDA

View Full Version : Saving Model Data to XML



Jarrod
13th August 2016, 23:27
Hi All,

How would I go about saving model data to a XML file? (Using QStandardItemModel and a QTableView)
I want to write the data to a XML file when my application is closed and parsed when I open it. I'm really struggling with this.
I have researched extensively but I can't find what I need.

Any help would be greatly appreciated.

Thanks.

jefftee
14th August 2016, 06:55
There's nothing built-in to do this, you'll have to traverse all of the data in the model and write out the XML you'd like using something like QXmlStreamWriter.

Jarrod
14th August 2016, 11:15
Thanks, I will re-read all information on QXmlStreamWriter again.