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
qgeotilespec.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
7
8#include <QtCore/QDebug>
9
11
12QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QGeoTileSpecPrivate)
13
14QGeoTileSpec::QGeoTileSpec()
15 : d(new QGeoTileSpecPrivate())
16{
17}
18
19QGeoTileSpec::QGeoTileSpec(const QString &plugin, int mapId, int zoom, int x, int y, int version)
20 : d(new QGeoTileSpecPrivate(plugin, mapId, zoom, x, y, version))
21{
22}
23
24QGeoTileSpec::QGeoTileSpec(const QGeoTileSpec &other) noexcept = default;
25
26QGeoTileSpec::~QGeoTileSpec() = default;
27
28QGeoTileSpec &QGeoTileSpec::operator=(const QGeoTileSpec &other) noexcept
29{
30 if (this == &other)
31 return *this;
32
33 d = other.d;
34 return *this;
35}
36
37QString QGeoTileSpec::plugin() const
38{
39 return d->plugin_;
40}
41
42void QGeoTileSpec::setZoom(int zoom)
43{
44 d->zoom_ = zoom;
45}
46
47int QGeoTileSpec::zoom() const
48{
49 return d->zoom_;
50}
51
52void QGeoTileSpec::setX(int x)
53{
54 d->x_ = x;
55}
56
57int QGeoTileSpec::x() const
58{
59 return d->x_;
60}
61
62void QGeoTileSpec::setY(int y)
63{
64 d->y_ = y;
65}
66
67int QGeoTileSpec::y() const
68{
69 return d->y_;
70}
71
72void QGeoTileSpec::setMapId(int mapId)
73{
74 d->mapId_ = mapId;
75}
76
77int QGeoTileSpec::mapId() const
78{
79 return d->mapId_;
80}
81
82void QGeoTileSpec::setVersion(int version)
83{
84 d->version_ = version;
85}
86
87int QGeoTileSpec::version() const
88{
89 return d->version_;
90}
91
92bool QGeoTileSpec::isEqual(const QGeoTileSpec &rhs) const noexcept
93{
94 return (*(d.constData()) == *(rhs.d.constData()));
95}
96
97bool QGeoTileSpec::isLess(const QGeoTileSpec &rhs) const noexcept
98{
99 return (*(d.constData()) < *(rhs.d.constData()));
100}
101
102size_t QGeoTileSpec::hash(size_t seed) const noexcept
103{
104 return d->hash(seed);
105}
106
107QDebug operator<< (QDebug dbg, const QGeoTileSpec &spec)
108{
109 dbg << spec.plugin() << spec.mapId() << spec.zoom() << spec.x() << spec.y() << spec.version();
110 return dbg;
111}
112
113bool QGeoTileSpecPrivate::operator<(const QGeoTileSpecPrivate &rhs) const
114{
115 if (plugin_ < rhs.plugin_)
116 return true;
117 if (plugin_ > rhs.plugin_)
118 return false;
119
120 if (mapId_ < rhs.mapId_)
121 return true;
122 if (mapId_ > rhs.mapId_)
123 return false;
124
125 if (zoom_ < rhs.zoom_)
126 return true;
127 if (zoom_ > rhs.zoom_)
128 return false;
129
130 if (x_ < rhs.x_)
131 return true;
132 if (x_ > rhs.x_)
133 return false;
134
135 if (y_ < rhs.y_)
136 return true;
137 if (y_ > rhs.y_)
138 return false;
139
140 return (version_ < rhs.version_);
141}
142
143QT_END_NAMESPACE
Combined button and popup list for selecting options.
QDebug operator<<(QDebug dbg, const QFileInfo &fi)