PDA

View Full Version : Need suggestion for to write QString to JSON format



wagmare
17th September 2014, 09:01
Hi Friends/Experts,
I need suggestion for my requirement of writting the QString data to json format.

Im reading data from dbus which returns me data in QString and QVariantMap and im using the data for my Qt GUI.
at the same time i have to feed the data to a web application .

the web application developer asked me to give the data in JSON format so he can read and write the data in his application .

so can you people suggest me a good way of writtin the data which comes from DBUS every time from DBUS to the JSON format .

Please provide me if any alternate solution or how i can synchronously write a JSON file .

Thanks in advance. .

anda_skoa
17th September 2014, 10:16
Qt5 has JSON support, e.g. QJsonDocument.

There are several Qt JSON libraries for Qt4, e.g. simply googling brings up https://github.com/gaudecker/qt-json and http://qjson.sourceforge.net/

Cheers,
_