57 void fetchContent(
const QUrl &url,
const QString &authcfg = QString() );
67 void fetchContent(
const QNetworkRequest &request,
const QString &authcfg = QString() );
73 QNetworkReply *
reply();
119 void errorOccurred( QNetworkReply::NetworkError code,
const QString &errorMsg );
124 std::unique_ptr<QNetworkReply> mReply;
126 bool mContentLoaded =
false;
128 bool mIsCanceled =
false;
135 QTextCodec *codecForHtml( QByteArray &array )
const;
143 void contentLoaded(
bool ok =
true );
QgsNetworkContentFetcher()=default
QString contentDispositionFilename() const
Returns the associated filename from the reply's content disposition header, if present.
void finished()
Emitted when content has loaded.
bool wasCanceled() const
Returns true if the fetching was canceled.
void errorOccurred(QNetworkReply::NetworkError code, const QString &errorMsg)
Emitted when an error with code error occurred while processing the request errorMsg is a textual des...
void cancel()
Cancels any ongoing request.
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
Emitted when data is received.
QNetworkReply * reply()
Returns a reference to the network reply.
QString contentAsString() const
Returns the fetched content as a string.
void fetchContent(const QUrl &url, const QString &authcfg=QString())
Fetches content from a remote URL and handles redirects.