Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgeomapversion.cpp
Go to the documentation of this file.
1// Copyright (C) 2014 Appello Systems AB.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#include <QJsonDocument>
7
9
10QGeoMapVersion::QGeoMapVersion()
11 : m_version(-1) {}
12
13bool QGeoMapVersion::isNewVersion(const QJsonObject &newVersionData) const
14{
15 return m_versionData != newVersionData;
16}
17
18int QGeoMapVersion::version() const
19{
20 return m_version;
21}
22
23void QGeoMapVersion::setVersion(int version)
24{
25 m_version = version;
26}
27
28void QGeoMapVersion::setVersionData(const QJsonObject &versionData)
29{
30 m_versionData = versionData;
31}
32
33
34QByteArray QGeoMapVersion::toJson() const
35{
36
37 QJsonObject object;
38 object[QLatin1String("version")] = m_version;
39 object[QLatin1String("data")] = m_versionData;
40
41 QJsonDocument document(object);
42
43 return document.toJson();
44}
45
46QT_END_NAMESPACE