summaryrefslogtreecommitdiffstats
path: root/src/corelib/json
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-09-27 11:13:49 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-11-08 09:50:32 +0000
commitbaebb6aa26799e627bc3be6bf41589cef422bed2 (patch)
treedfa33faec314b1988b415a110e77c66d36b09d2b /src/corelib/json
parentc6477286525682773ae3739fee53689e225d1b0a (diff)
QVariant to QJsonValue::Null conversion
Adds a few missing parts of the conversion from QVariant to QJsonValue after the introduction of the nullptr QVariant. The conversion the other way is already implemented. Change-Id: I8b25dec4b476c4761c5098a60944ff11c36f8bec Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/json')
-rw-r--r--src/corelib/json/qjsonvalue.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/json/qjsonvalue.cpp b/src/corelib/json/qjsonvalue.cpp
index 5a906dda7b..4b52014db1 100644
--- a/src/corelib/json/qjsonvalue.cpp
+++ b/src/corelib/json/qjsonvalue.cpp
@@ -349,6 +349,12 @@ QJsonValue &QJsonValue::operator =(const QJsonValue &other)
\row
\li
\list
+ \li QMetaType::Nullptr
+ \endlist
+ \li QJsonValue::Null
+ \row
+ \li
+ \list
\li QMetaType::Bool
\endlist
\li QJsonValue::Bool
@@ -393,6 +399,8 @@ QJsonValue &QJsonValue::operator =(const QJsonValue &other)
QJsonValue QJsonValue::fromVariant(const QVariant &variant)
{
switch (variant.userType()) {
+ case QMetaType::Nullptr:
+ return QJsonValue(Null);
case QVariant::Bool:
return QJsonValue(variant.toBool());
case QVariant::Int: