I want to Save Configuration Settings to XML file in QT and read it from there ?
What is best approach to do this in QT ?
Any sample/ideas are highly appreciated.
Thanks.
To write XML document with QXmlStreamWriter, you start a document with the writeStartDocument() function and end it with writeEndDocument(), which implicitly closes all remaining open tags.
Qt provides two general-purpose sets of APIs to read and write well-formed XML: stream based and DOM based. Qt also provides specific support for some XML dialects.
You can register your XML file format with QSettings::registerFormat
Here's a sample implementation of the readXmlFile
and writeXmlFile
There is Qt examples for XML.
Also you can use QSettings to store your settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With