Skip to content

Instantly share code, notes, and snippets.

@vicatcu
Created September 9, 2016 18:47
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 vicatcu/ad2350f3772cdec68660db3f96efc93c to your computer and use it in GitHub Desktop.
Save vicatcu/ad2350f3772cdec68660db3f96efc93c to your computer and use it in GitHub Desktop.
#include <QCoreApplication>
#include <QDebug>
#include <QStringList>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>
#include <QVariant>
#include <QJsonValue>
#include <QByteArray>
#include <QDataStream>
QString mapToString(QVariantMap &map){
QString buf;
QDebug myDbg(&buf);
myDbg << map;
return QString(buf);
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QVariantMap map;
map.insert("a", QVariant("123"));
map.insert("b", QVariant("234"));
qDebug() << mapToString(map);
return a.exec();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment