summaryrefslogtreecommitdiffstats
path: root/src/corelib/json/qjsonobject.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-10-30 10:59:11 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2014-10-30 12:14:42 +0100
commitae981f224de9d2a24bfb1547e2049b6ccd9fc4ac (patch)
treee3d7fa60a8eb697baf96f4f9afa1e32c70a64c03 /src/corelib/json/qjsonobject.h
parentd7ca800a87a2291c94c6580f0cfe068bb2280caf (diff)
Add conversion between QVariantHash and QJsonObject
Adds automatic conversion from QVariants with a QVariantHash to QJsonValue and explicit methods for conversion between QVariantHash and QJsonObject. [ChangeLog][QtCore][QJsonObject] Added conversion to and from QVariantHash Change-Id: I140ef881463acabaab2648e28209487d8ad18e0d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/corelib/json/qjsonobject.h')
-rw-r--r--src/corelib/json/qjsonobject.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/json/qjsonobject.h b/src/corelib/json/qjsonobject.h
index 9abdb047ed..272cf14b01 100644
--- a/src/corelib/json/qjsonobject.h
+++ b/src/corelib/json/qjsonobject.h
@@ -46,6 +46,8 @@ QT_BEGIN_NAMESPACE
class QDebug;
template <class Key, class T> class QMap;
typedef QMap<QString, QVariant> QVariantMap;
+template <class Key, class T> class QHash;
+typedef QHash<QString, QVariant> QVariantHash;
class Q_CORE_EXPORT QJsonObject
{
@@ -68,6 +70,8 @@ public:
static QJsonObject fromVariantMap(const QVariantMap &map);
QVariantMap toVariantMap() const;
+ static QJsonObject fromVariantHash(const QVariantHash &map);
+ QVariantHash toVariantHash() const;
QStringList keys() const;
int size() const;