Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtlocation.qdoc
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
5
6
7/*!
8 \module QtLocation
9 \title Qt Location C++ Classes
10 \ingroup modules
11 \qtvariable location
12
13 \brief Provides C++ interfaces to retrieve location and navigational
14 information.
15
16 The C++ API provides access to geocoding and navigation information,
17 and also place search. Use the \l{Maps and Navigation (QML)}{QML}
18 API to render this information on an interactive map that supports
19 touch gestures, overlays, and so on.
20
21 Include the appropriate header in your C++ code. For example,
22 applications using routes can include:
23
24 \code
25 #include <QGeoRoute>
26 \endcode
27
28 Add the \e location keyword in the project file to link against the
29 Qt Location library:
30
31 \badcode
32 QT += location
33 \endcode
34
35 See more in the \l{Qt Location}{Qt Location Overview}.
36
37*/
38
39
40
41/*!
42\page qtlocation-index.html
43\title Qt Location
44\brief Provides QML and C++ interfaces to create location-aware
45applications.
46\ingroup technology-apis
47
48The Qt Location module helps you create mapping solutions using data available
49from popular location service providers, such as
50\l {http://openstreetmap.org}{Open Street Map}.
51
52The Qt Location API enables you to:
53\list
54 \li Access and present map data.
55 \li Support touch gesture on a specific area of the map.
56 \li Query for a specific geographical location and route.
57 \li Add additional layers on top, such as polylines and circles.
58 \li Search for places and related images.
59\endlist
60
61\section1 Using the Module
62
63\section2 QML API
64
65To use the types, add the following import statements to your \c .qml file:
66
67\qml \QtVer
68import QtPositioning
69import QtLocation
70\endqml
71
72\note Many Qt Location QML module APIs are using types from the Qt Positioning
73module. For example, defining a coordinate to be the center of the map requires
74types from the Qt Positioning module.
75
76\section2 C++ API
77
78For C++ projects, include the header appropriate for the current use case;
79for example, applications using routes may use:
80
81\code
82#include <QGeoRoute>
83\endcode
84
85\include {module-use.qdocinc} {using the c++ api}
86
87\section3 Building with CMake
88
89\include {module-use.qdocinc} {building with cmake} {Location}
90
91\section3 Building with qmake
92
93\include {module-use.qdocinc} {building_with_qmake} {location}
94
95\section1 Submodules
96
97The API is split into sub-modules, which provide QML and C++ interfaces for
98specific purposes. They focus mainly on Map and Place information. The required
99position data can be retrieved using the \l {QtPositioning} module.
100
101\section2 Places
102
103The Places submodule is the natural complement to Positioning, providing a
104source of geographical data about Places of Interest (POI). Besides the source
105information, the API provides information about the location, size, and
106other related information about a POI. The Places API can also
107retrieve images, reviews, and other content related to a place.
108
109\table
110\row
111 \li Places introduction:
112 \li \l{QML Places API}{for QML}
113 \li \l{Places (C++)}{for C++}
114\endtable
115
116\section2 Maps and Navigation
117
118The module provides the QML and C++ alternatives for maps and navigation. The
119C++ alternative provides utility classes to get geocoding (finding a geographic
120coordinate from a street address) and navigation (including driving and walking
121directions) information, whereas its QML counterpart provides UI components to
122render the information.
123
124\table
125\row
126\li Maps and Navigation introduction:
127 \li \l{Maps and Navigation (QML)}{for QML}
128 \li \l{Maps and Navigation (C++)}{for C++}
129\endtable
130
131\section1 Examples
132\table
133 \row
134 \li \l {Qt Location Examples}{Example Apps}
135 \li Examples demonstrating use of the Qt Location APIs
136 \row
137 \li \l {QML Maps}{Maps and Navigation Tutorial}
138 \li Tutorial introducing the QML Maps Types
139\endtable
140
141\section1 API Reference
142
143The following are lists of the classes and UI components provided by the module,
144with example applications to demonstrate their usage:
145
146\table
147 \row
148 \li \l {Qt Location QML Types}{QML API Reference}
149 \li Full list of QML components in the Qt Location API
150 \row
151 \li \l {Qt Location C++ API}{C++ API Reference by domain}
152 \li Full list of C++ classes and methods of the Qt Location APIs sorted by domain
153 \row
154 \li \l {Qt Location C++ Classes}{C++ API Reference}
155 \li Full list of C++ classes and methods of the Qt Location APIs
156\endtable
157
158\section1 Plugin References and Parameters
159
160Information about plugins, important notes on their usage, parameters that can
161be provided to influence their behavior.
162
163\annotatedlist QtLocation-plugins
164
165\section2 Implementing New Back-Ends and Porting
166
167For systems integrators and distributors, information related to making
168Qt Location available for a new platform.
169
170\table
171 \row
172 \li \l {Qt Location GeoServices}{GeoServices}
173 \li Information about the Qt Location GeoServices plugins
174 \row
175 \li \l {Places Backend} {Places}
176 \li Information for places backend implementors
177 \row
178 \li \l {Changes to Qt Location}{API changes}
179 \li Information about porting from Qt 5 to Qt 6
180\endtable
181
182\section1 Licenses
183
184Qt Location is available under commercial licenses from \l{The Qt Company}.
185In addition, it is available under the
186\l{GNU Lesser General Public License, version 3}, or
187the \l{GNU General Public License, version 2}.
188See \l{Qt Licensing} for further details.
189*/