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
qgeomapreplymapbox.cpp
Go to the documentation of this file.
1// Copyright (C) 2014 Canonical Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#include <QtLocation/private/qgeotilespec_p.h>
7
9: QGeoTiledMapReply(spec, parent), m_format (format)
10{
11 if (!reply) {
12 setError(UnknownError, QStringLiteral("Null reply"));
13 return;
14 }
16 this, &QGeoMapReplyMapbox::networkReplyFinished);
18 this, &QGeoMapReplyMapbox::networkReplyError);
21}
22
26
27void QGeoMapReplyMapbox::networkReplyFinished()
28{
29 QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
31
33 return;
34
36 setMapImageFormat(m_format);
37 setFinished(true);
38}
39
40void QGeoMapReplyMapbox::networkReplyError(QNetworkReply::NetworkError error)
41{
42 QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
45 setFinished(true);
46 else
48}
QGeoMapReplyMapbox(QNetworkReply *reply, const QGeoTileSpec &spec, const QString &format, QObject *parent=nullptr)
\inmodule QtLocation
void setMapImageFormat(const QString &format)
Sets the format of the tile image to format.
Error error() const
Returns the error state of this reply.
void setFinished(bool finished)
Sets whether or not this reply has finished to finished.
void setError(Error error, const QString &errorString)
Sets the error state of this reply to error and the textual representation of the error to errorStrin...
void setMapImageData(const QByteArray &data)
Sets the tile image data to data.
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.
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.
\inmodule QtCore
Definition qobject.h:103
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
Definition qobject.cpp:2658
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
void deleteLater()
\threadsafe
Definition qobject.cpp:2435
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
DBusConnection const char DBusError * error
GLint GLsizei GLsizei GLenum format
#define QStringLiteral(str)
QNetworkReply * reply