8#include <QtCore/QJsonDocument>
9#include <QtCore/QJsonArray>
10#include <QtCore/QJsonObject>
11#include <QtNetwork/QNetworkReply>
12#include <QtPositioning/QGeoCircle>
13#include <QtPositioning/QGeoRectangle>
14#include <QtLocation/QPlace>
15#include <QtLocation/QPlaceCategory>
16#include <QtLocation/QPlaceIcon>
17#include <QtLocation/QPlaceResult>
18#include <QtLocation/QPlaceSearchRequest>
19#include <QtLocation/QPlaceContactDetail>
59 icon.setParameters(iconParameters);
72 if (!categoryString.
isEmpty()) {
131void QPlaceSearchReplyMapbox::onReplyFinished()
140 if (!document.isObject()) {
157 bool categoryMatch =
false;
158 if (!placeCategories.
isEmpty()) {
161 categoryMatch =
true;
175 return a.distance() < b.distance();
179 return a.place().name() < b.place().name();
Q_INVOKABLE qreal distanceTo(const QGeoCoordinate &other) const
Returns the distance (in meters) from this coordinate to the coordinate specified by other.
QGeoCoordinate coordinate() const
Returns the coordinate of the location.
QByteArray readAll()
Reads all remaining data from the device, and returns it as a byte array.
QString errorString() const
Returns a human-readable description of the last device error that occurred.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error=nullptr)
Parses json as a UTF-8 encoded JSON document, and creates a QJsonDocument from it.
\inmodule QtCore\reentrant
QJsonValue value(const QString &key) const
Returns a QJsonValue representing the value for the key key.
\inmodule QtCore\reentrant
QJsonObject toObject() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString toString() const
Converts the value to a QString and returns it.
bool isEmpty() const noexcept
void append(parameter_type t)
iterator insert(const Key &key, const T &value)
static QString mapboxNameForCategory(const QString &category)
static QGeoLocation parseGeoLocation(const QJsonObject &response)
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager.
void errorOccurred(QNetworkReply::NetworkError)
NetworkError error() const
Returns the error that was found during the processing of this request.
virtual void abort()=0
Aborts the operation immediately and close down any network connections still open.
NetworkError
Indicates all possible error conditions found during the processing of the request.
void finished()
This signal is emitted when the reply has finished processing.
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
void deleteLater()
\threadsafe
static const QString SingleUrl
\qmlvaluetype icon \inqmlmodule QtLocation
QPlaceReply::Error error() const
Returns the error code.
void errorOccurred(QPlaceReply::Error error, const QString &errorString=QString())
This signal is emitted when an error has been detected in the processing of this reply.
void finished()
This signal is emitted when this reply has finished processing.
Error
Describes an error which occurred during an operation.
QString errorString() const
Returns the error string of the reply.
void setError(QPlaceReply::Error error, const QString &errorString)
Sets the error and errorString of the reply.
void setFinished(bool finished)
Sets the status of whether the reply is finished or not.
void setDistance(qreal distance)
Set the distance of the search result's place from a search center.
QPlace place() const
Returns the place of the search result.
~QPlaceSearchReplyMapbox()
QPlaceSearchReplyMapbox(const QPlaceSearchRequest &request, QNetworkReply *reply, QPlaceManagerEngineMapbox *parent)
void setError(QPlaceReply::Error errorCode, const QString &errorString)
void setRequest(const QPlaceSearchRequest &request)
Sets the search request used to generate this reply.
QPlaceSearchRequest request() const
Returns the search request that was used to generate this reply.
QList< QPlaceSearchResult > results() const
Returns a list of search results;.
void setResults(const QList< QPlaceSearchResult > &results)
Sets the list of search results.
QGeoShape searchArea() const
Returns the search area which will be used to limit search results.
QList< QPlaceCategory > categories() const
Return the categories to be used in the search request.
void setVisibility(QLocation::Visibility visibility)
Sets the visibility of the place to visibility.
void setDetailsFetched(bool fetched)
Sets whether the details of this place have been fetched or not.
void setIcon(const QPlaceIcon &icon)
Sets the icon of the place.
void setContactDetails(const QString &contactType, QList< QPlaceContactDetail > details)
Sets the contact details of a specified contactType.
void setPlaceId(const QString &identifier)
Sets the identifier of the place.
void setAttribution(const QString &attribution)
Sets the attribution string of the place.
QList< QPlaceCategory > categories() const
Returns categories that this place belongs to.
void setLocation(const QGeoLocation &location)
Sets the location of the place.
QGeoLocation location() const
Returns the location of the place.
void setCategories(const QList< QPlaceCategory > &categories)
Sets the categories that this place belongs to.
void setName(const QString &name)
Sets the name of the place.
QString name() const
Returns the name of the place.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
const QLoggingCategory & category()
[1]
Combined button and popup list for selecting options.
QPlaceResult parsePlaceResult(const QJsonObject &response, const QString &attribution)
emscripten::val document()
static const QCssKnownValue properties[NumProperties - 1]
DBusConnection const char DBusError * error
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLsizei GLenum * categories
#define QStringLiteral(str)
QNetworkRequest request(url)
char * toString(const MyType &t)
[31]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent