how to get indented JSON values in C++ ?
-
wrote on 3 Jun 2016, 10:55 last edited by
Thanks paul colby !! It worked out .
-
wrote on 4 Jun 2016, 19:13 last edited by
i also want to get pageid and revid too .
I tried this : but was not able to get the pageid :/
jsonResponse.object()["parse"].toObject()["pageid"].toString();
-
i also want to get pageid and revid too .
I tried this : but was not able to get the pageid :/
jsonResponse.object()["parse"].toObject()["pageid"].toString();
wrote on 4 Jun 2016, 19:23 last edited byThe
pageid
value in your JSON is not a string but rather an integer, hence you have to useQJsonValue::toInt()
instead ofQJsonValue::toString()
:jsonResponse.object()["parse"].toObject()["pageid"].toInt();
-
wrote on 8 Aug 2018, 14:45 last edited by
Hi All,
Need some help from you,
How to remove "\n" between Two Json Attribute while printing . -
Hi All,
Need some help from you,
How to remove "\n" between Two Json Attribute while printing .@Anil-Patel
Hi
Show how you "print" please ? -
@Anil-Patel
Hi
Show how you "print" please ?wrote on 9 Aug 2018, 07:30 last edited by@mrjj {
"app": "PromotionDngineyscad",
"host": "WINASBAV7d7d750142-UBN",
"log": "PromoLog",
"lvl": "Messages",
"msg": "Initialized",
"thread": "237fbb2db10",
"timestamp": "1533796312.526572",
"uuid": "e62191c4-8891-4c92-a908-da01a3dakje3ac7ad"
} -
@mrjj {
"app": "PromotionDngineyscad",
"host": "WINASBAV7d7d750142-UBN",
"log": "PromoLog",
"lvl": "Messages",
"msg": "Initialized",
"thread": "237fbb2db10",
"timestamp": "1533796312.526572",
"uuid": "e62191c4-8891-4c92-a908-da01a3dakje3ac7ad"
}@Anil-Patel You should reread the question from @mrjj
-
@mrjj {
"app": "PromotionDngineyscad",
"host": "WINASBAV7d7d750142-UBN",
"log": "PromoLog",
"lvl": "Messages",
"msg": "Initialized",
"thread": "237fbb2db10",
"timestamp": "1533796312.526572",
"uuid": "e62191c4-8891-4c92-a908-da01a3dakje3ac7ad"
}Lifetime Qt Championwrote on 9 Aug 2018, 09:17 last edited by mrjj 8 Sept 2018, 12:48@Anil-Patel
I did mean the code :)
if you use printf, qDebug, or what ever.You could use QString's replace if the newline are truely in the the json string. -
Hi All,
Need some help from you,
How to remove "\n" between Two Json Attribute while printing .wrote on 9 Aug 2018, 11:37 last edited by@Anil-Patel Hi,
Please make a new post for a new question, even more if you are not the author of the original question...For your issue, I think you need to call
QJsonDocument::toJson(
QJsonDocument::Compact)
when you export your json content to string. -
@Anil-Patel Hi,
Please make a new post for a new question, even more if you are not the author of the original question...For your issue, I think you need to call
QJsonDocument::toJson(
QJsonDocument::Compact)
when you export your json content to string.wrote on 9 Aug 2018, 12:24 last edited by@Gojir4
Sure, Thanks for your Help.