Consistency between null QJsonValue and QVariant
Unsolved
General and Desktop
-
wrote on 28 May 2020, 09:11 last edited by Moia
Suppose to have QJsonValue with a null type and then convert it to QVariant. This QVariant converted has type std::nullptr_t. It's just me or does not exists a way to instantiate a QVariant which match that type?
QJsonValue value{QJsonValue::Null}; QVariant variant = value.toVariant(); qDebug() << value << variant; // QJsonValue(null) QVariant(std::nullptr_t, (nullptr)) qDebug() << variant.isNull() << variant.isValid(); // true true qDebug() << variant.type() << variant.typeName(); // QVariant::std::nullptr_t std::nullptr_t
-
Suppose to have QJsonValue with a null type and then convert it to QVariant. This QVariant converted has type std::nullptr_t. It's just me or does not exists a way to instantiate a QVariant which match that type?
QJsonValue value{QJsonValue::Null}; QVariant variant = value.toVariant(); qDebug() << value << variant; // QJsonValue(null) QVariant(std::nullptr_t, (nullptr)) qDebug() << variant.isNull() << variant.isValid(); // true true qDebug() << variant.type() << variant.typeName(); // QVariant::std::nullptr_t std::nullptr_t
-
wrote on 29 May 2020, 13:59 last edited by
How can I create a QVariant with the same state Variant(std::nullptr_t, (nullptr)) ?
1/5