blob: 0df880a0a5679c4abf6ee6c33245364973edb99a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/******************************************************************************
* SPDX-FileCopyrightText: 2018 Kitsune Ral <kitsune-ral@users.sf.net>
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "converters.h"
#include <QtCore/QVariant>
using namespace Quotient;
QJsonValue JsonConverter<QVariant>::dump(const QVariant& v)
{
return QJsonValue::fromVariant(v);
}
QVariant JsonConverter<QVariant>::load(const QJsonValue& jv)
{
return jv.toVariant();
}
QJsonObject JsonConverter<QVariantHash>::dump(const QVariantHash& vh)
{
return QJsonObject::fromVariantHash(vh);
}
QVariantHash JsonConverter<QVariantHash>::load(const QJsonValue& jv)
{
return jv.toObject().toVariantHash();
}
|