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
qgeocodingmanager.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 "qgeocodingmanager.h"
7
8#include "qgeorectangle.h"
9#include "qgeocircle.h"
10
11#include <QLocale>
12
14
47QGeoCodingManager::QGeoCodingManager(QGeoCodingManagerEngine *engine, QObject *parent)
48 : QObject(parent),
49 d_ptr(new QGeoCodingManagerPrivate())
50{
51 d_ptr->engine.reset(engine);
52 if (d_ptr->engine) {
53 d_ptr->engine->setParent(this);
54
55 connect(d_ptr->engine.get(), &QGeoCodingManagerEngine::finished,
57
60 } else {
61 qFatal("The geocoding manager engine that was set for this geocoding manager was NULL.");
62 }
63}
64
69{
70 delete d_ptr;
71}
72
81{
82// if (!d_ptr->engine)
83// return QString();
84
85 return d_ptr->engine->managerName();
86}
87
96{
97// if (!d_ptr->engine)
98// return -1;
99
100 return d_ptr->engine->managerVersion();
101}
102
135{
136 return d_ptr->engine->geocode(address, bounds);
137}
138
139
177{
178 return d_ptr->engine->reverseGeocode(coordinate, bounds);
179}
180
211 int limit,
212 int offset,
213 const QGeoShape &bounds)
214{
215 QGeoCodeReply *reply = d_ptr->engine->geocode(address,
216 limit,
217 offset,
218 bounds);
219 return reply;
220}
221
231{
232 d_ptr->engine->setLocale(locale);
233}
234
240{
241 return d_ptr->engine->locale();
242}
243
274/*******************************************************************************
275*******************************************************************************/
276
\inmodule QtPositioning
Definition qgeoaddress.h:18
\inmodule QtLocation
void errorOccurred(QGeoCodeReply *reply, QGeoCodeReply::Error error, const QString &errorString=QString())
void finished(QGeoCodeReply *reply)
std::unique_ptr< QGeoCodingManagerEngine > engine
void errorOccurred(QGeoCodeReply *reply, QGeoCodeReply::Error error, const QString &errorString=QString())
QGeoCodeReply * geocode(const QGeoAddress &address, const QGeoShape &bounds=QGeoShape())
Begins the geocoding of address.
~QGeoCodingManager()
Destroys this manager.
QString managerName() const
Returns the name of the engine which implements the behaviour of this geocoding manager.
int managerVersion() const
Returns the version of the engine which implements the behaviour of this geocoding manager.
QGeoCodeReply * reverseGeocode(const QGeoCoordinate &coordinate, const QGeoShape &bounds=QGeoShape())
Begins the reverse geocoding of coordinate.
void setLocale(const QLocale &locale)
Sets the locale to be used by this manager to locale.
QLocale locale() const
Returns the locale used to hint to this geocoding manager about what language to use for the results.
void finished(QGeoCodeReply *reply)
\inmodule QtPositioning
\inmodule QtPositioning
Definition qgeoshape.h:17
\inmodule QtCore
Definition qobject.h:103
void setParent(QObject *parent)
Makes the object a child of parent.
Definition qobject.cpp:2195
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
#define qFatal
Definition qlogging.h:168
GLenum GLuint GLintptr offset
GLint limit
GLuint GLuint64EXT address
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
QNetworkReply * reply
QJSEngine engine
[0]