Add QJsonValueRef::toVariant()

to better mirror the API of QJsonValue

Task-number: QTBUG-43686
Change-Id: I83edecf5226d44980a8a442a512a13ab9b2ac6a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Lars Knoll 2015-03-11 14:47:48 +01:00 committed by Lars Knoll
parent 7c77013c7f
commit 75cb6f59f1
2 changed files with 6 additions and 0 deletions

View File

@ -704,6 +704,11 @@ QJsonValueRef &QJsonValueRef::operator =(const QJsonValueRef &ref)
return *this;
}
QVariant QJsonValueRef::toVariant() const
{
return toValue().toVariant();
}
QJsonArray QJsonValueRef::toArray() const
{
return toValue().toArray();

View File

@ -146,6 +146,7 @@ public:
QJsonValueRef &operator = (const QJsonValue &val);
QJsonValueRef &operator = (const QJsonValueRef &val);
QVariant toVariant() const;
inline QJsonValue::Type type() const { return toValue().type(); }
inline bool isNull() const { return type() == QJsonValue::Null; }
inline bool isBool() const { return type() == QJsonValue::Bool; }