PDA

View Full Version : not able to save form data to json file



shoeb
31st March 2016, 14:20
Hello friends,

I'm new to QT and i am facing problem with the use of json file in QT.
I want to save the "Form data " on click on pushbutton (such as multiple student information) to json file and again load the respective student data.

Can anybody suggest me how to do that?

Thanks in advance.

Regards,
Shoeb

anda_skoa
31st March 2016, 15:31
What do you have so far?

Did you create a QJsonDocument containing your data?

Cheers,
_

shoeb
1st April 2016, 09:15
Hi,

No.. i'm not understanding that how to create QJsonDocument.

I have saved that data in QJsonObject.

-Shoeb

anda_skoa
1st April 2016, 10:12
QJsonDocument::setObject()?

Cheers,
_

ChrisW67
1st April 2016, 11:23
Or just construct it from the QJsonObject using QJsonDocument::QJsonDocument()


QJSonObject object;
// build JSON object
QJsonDocument doc(object);