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
qgeomaptype.cpp
Go to the documentation of this file.
1
// Copyright (C) 2015 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
4
#
include
"qgeomaptype_p.h"
5
#
include
"qgeomaptype_p_p.h"
6
7
QT_BEGIN_NAMESPACE
8
9
QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QGeoMapTypePrivate)
10
11
/*!
12
\qmltype mapType
13
\inqmlmodule QtLocation
14
\ingroup qml-QtLocation5-maps
15
\since QtLocation 5.5
16
17
\brief The mapType type holds information about a map type.
18
19
This includes the map type's \l name and \l description, the \l style and
20
a flag to indicate if the map type is optimized for mobile devices (\l mobile).
21
*/
22
23
QGeoMapType::QGeoMapType()
24
: d_ptr(
new
QGeoMapTypePrivate()) {}
25
26
QGeoMapType::QGeoMapType(
const
QGeoMapType &other)
noexcept
=
default
;
27
28
QGeoMapType::QGeoMapType(QGeoMapType::MapStyle style,
const
QString &name,
29
const
QString &description,
bool
mobile,
bool
night,
int
mapId,
30
const
QByteArray &pluginName,
31
const
QGeoCameraCapabilities &cameraCapabilities,
32
const
QVariantMap &metadata)
33
: d_ptr(
new
QGeoMapTypePrivate(style, name, description, mobile, night, mapId, pluginName, cameraCapabilities, metadata))
34
{
35
}
36
37
QGeoMapType::~QGeoMapType() =
default
;
38
39
QGeoMapType &QGeoMapType::operator=(
const
QGeoMapType &other)
noexcept
40
{
41
if
(
this
== &other)
42
return
*
this
;
43
44
d_ptr = other.d_ptr;
45
return
*
this
;
46
}
47
48
bool
QGeoMapType::isEqual(
const
QGeoMapType &other)
const
noexcept
49
{
50
return
(*d_ptr.constData() == *other.d_ptr.constData());
51
}
52
53
/*!
54
\qmlproperty enumeration mapType::style
55
56
This read-only property gives access to the style of the map type.
57
58
\list
59
\li MapType.NoMap - No map.
60
\li MapType.StreetMap - A street map.
61
\li MapType.SatelliteMapDay - A map with day-time satellite imagery.
62
\li MapType.SatelliteMapNight - A map with night-time satellite imagery.
63
\li MapType.TerrainMap - A terrain map.
64
\li MapType.HybridMap - A map with satellite imagery and street information.
65
\li MapType.GrayStreetMap - A gray-shaded street map.
66
\li MapType.PedestrianMap - A street map suitable for pedestriants.
67
\li MapType.CarNavigationMap - A street map suitable for car navigation.
68
\li MapType.CycleMap - A street map suitable for cyclists.
69
\li MapType.CustomMap - A custom map type.
70
\endlist
71
*/
72
73
QGeoMapType::MapStyle QGeoMapType::style()
const
74
{
75
return
d_ptr->style_;
76
}
77
78
/*!
79
\qmlproperty string mapType::name
80
81
This read-only property holds the name of the map type as a single formatted string.
82
*/
83
84
QString QGeoMapType::name()
const
85
{
86
return
d_ptr->name_;
87
}
88
89
/*!
90
\qmlproperty string mapType::description
91
92
This read-only property holds the description of the map type as a single formatted string.
93
*/
94
95
QString QGeoMapType::description()
const
96
{
97
return
d_ptr->description_;
98
}
99
100
/*!
101
\qmlproperty bool mapType::mobile
102
103
\brief Whether the map type is optimized for the use on a mobile device.
104
105
Map types for mobile devices usually have higher constrast to counteract the
106
effects of sunlight and a reduced color for improved readability.
107
*/
108
bool
QGeoMapType::mobile()
const
109
{
110
return
d_ptr->mobile_;
111
}
112
113
/*!
114
\qmlproperty bool mapType::night
115
\since QtLocation 5.4
116
117
\brief Whether the map type is optimized for use at night.
118
119
Map types suitable for use at night usually have a dark background.
120
*/
121
bool
QGeoMapType::night()
const
122
{
123
return
d_ptr->night_;
124
}
125
126
int
QGeoMapType::mapId()
const
127
{
128
return
d_ptr->mapId_;
129
}
130
131
QByteArray QGeoMapType::pluginName()
const
132
{
133
return
d_ptr->pluginName_;
134
}
135
136
/*!
137
\qmlproperty CameraCapabilities mapType::cameraCapabilities
138
\since QtLocation 5.10
139
140
This property holds the camera capabilities for this map type.
141
*/
142
143
QGeoCameraCapabilities QGeoMapType::cameraCapabilities()
const
144
{
145
return
d_ptr->cameraCapabilities_;
146
}
147
148
/*!
149
\qmlproperty VariantMap mapType::metadata
150
\since QtLocation 5.10
151
152
This property holds optional, extra metadata related to a specific map type.
153
The content of this property is entirely plugin-specific.
154
*/
155
QVariantMap QGeoMapType::metadata()
const
156
{
157
return
d_ptr->metadata_;
158
}
159
160
QGeoMapTypePrivate
::
QGeoMapTypePrivate
() =
default
;
161
162
QGeoMapTypePrivate
::QGeoMapTypePrivate(QGeoMapType::MapStyle style,
const
QString &name,
163
const
QString &description,
bool
mobile,
bool
night,
164
int
mapId,
const
QByteArray &pluginName,
165
const
QGeoCameraCapabilities &cameraCapabilities,
166
const
QVariantMap &metadata)
167
: name_(name), description_(description), pluginName_(pluginName),
168
cameraCapabilities_(cameraCapabilities), metadata_(metadata),
169
style_(style),
mapId_
(mapId),
mobile_
(mobile),
night_
(night)
170
{
171
}
172
173
bool
QGeoMapTypePrivate
::
operator
==(
const
QGeoMapTypePrivate
&other)
const
174
{
175
return
pluginName_ == other.pluginName_ && style_ == other.style_ && name_ == other.name_ &&
176
description_ == other.description_ && mobile_ == other.mobile_ && night_ == other.night_ &&
177
mapId_ == other.mapId_ && cameraCapabilities_ == other.cameraCapabilities_ &&
178
metadata_ == other.metadata_;
179
}
180
181
QT_END_NAMESPACE
182
183
#
include
"moc_qgeomaptype_p.cpp"
QGeoMapTypePrivate
Definition
qgeomaptype_p_p.h:29
QGeoMapTypePrivate::night_
bool night_
Definition
qgeomaptype_p_p.h:47
QGeoMapTypePrivate::operator==
bool operator==(const QGeoMapTypePrivate &other) const
Definition
qgeomaptype.cpp:173
QGeoMapTypePrivate::mapId_
int mapId_
Definition
qgeomaptype_p_p.h:45
QGeoMapTypePrivate::QGeoMapTypePrivate
QGeoMapTypePrivate()
QGeoMapTypePrivate::mobile_
bool mobile_
Definition
qgeomaptype_p_p.h:46
qtlocation
src
location
maps
qgeomaptype.cpp
Generated on
for Qt by
1.14.0