qjsonobject

How to convert a QJsonObject to QString

雨燕双飞 提交于 2019-12-18 11:03:21
问题 I have a QJsonObject data and want to convert to QString. How can I do this? Searched for help in Qt, it only can convert QJsonObject to QVariantMap... Thanks in advance. 回答1: Remembering when I first needed to do this, the documentation can be a bit lacking and assumes you have knowledge of other QJson classes. To obtain a QString of a QJsonObject, you need to use the QJsonDocument class, like this: - QJsonObject jsonObj; // assume this has been populated with Json data QJsonDocument doc

Delete a child attribute from json file

别说谁变了你拦得住时间么 提交于 2019-12-11 18:08:26
问题 I have the following HTTP JSON-response in Java, which represents a user object. { "account": "Kpatrick", "firstname": "Patrick", [ ], "instances": [ { "id": "packerer-pool", "key": "packerer-pool123", "userAccount": "kpatrick", "firstname": "Patrick", "lastname": "Schmidt", } ], "projects": [ { "id": "packerer-projectPool", "projectKey": "projectPool-Pool", "cqprojectName": "xxxxx", }, { "id": "packerer-secondproject", "projectKey": "projectPool-Pool2", "cqprojectName": "xxxx", }, { "id":