From baebb6aa26799e627bc3be6bf41589cef422bed2 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 27 Sep 2016 11:13:49 +0200 Subject: 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) --- src/corelib/json/qjsonvalue.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/corelib/json') 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 @@ -346,6 +346,12 @@ QJsonValue &QJsonValue::operator =(const QJsonValue &other) \header \li Source type \li Destination type + \row + \li + \list + \li QMetaType::Nullptr + \endlist + \li QJsonValue::Null \row \li \list @@ -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: -- cgit v1.2.3