Skip to content

Instantly share code, notes, and snippets.

@dridk
Created December 3, 2012 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dridk/4196811 to your computer and use it in GitHub Desktop.
Save dridk/4196811 to your computer and use it in GitHub Desktop.
qxtjson example
//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