Created
December 3, 2012 18:13
-
-
Save dridk/4196811 to your computer and use it in GitHub Desktop.
qxtjson example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//parser un json (QString) vers un QVariant | |
QString source = "{"name": "sacha"} | |
QVariant data = QxtJson::parse(source); | |
//affiche "sacha" | |
qDebug()<<data.toMap().value("name").toString(); | |
//ecrire du json | |
QVariantMap data; | |
data.insert("name", "olivier"); | |
QString source = QxtJson::parse(data); | |
//affiche du json " {"name":"olivier"} " | |
qDebug()<<json; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment