QGIS API Documentation
3.2.0-Bonn (bc43194)
|
HTTP network content fetcher. More...
#include <qgsnetworkcontentfetcher.h>
Signals | |
void | downloadProgress (qint64 bytesReceived, qint64 bytesTotal) |
Emitted when data is received. More... | |
void | finished () |
Emitted when content has loaded. More... | |
Public Member Functions | |
QgsNetworkContentFetcher ()=default | |
Constructor for QgsNetworkContentFetcher. More... | |
~QgsNetworkContentFetcher () override | |
void | cancel () |
Cancels any ongoing request. More... | |
QString | contentAsString () const |
Returns the fetched content as a string. More... | |
void | fetchContent (const QUrl &url) |
Fetches content from a remote URL and handles redirects. More... | |
void | fetchContent (const QNetworkRequest &request) |
Fetches content using a network request and handles redirects. More... | |
QNetworkReply * | reply () |
Returns a reference to the network reply. More... | |
HTTP network content fetcher.
A simple method for fetching remote HTTP content and converting the content to standard formats. Url redirects are automatically handled.
Definition at line 37 of file qgsnetworkcontentfetcher.h.
|
default |
Constructor for QgsNetworkContentFetcher.
|
override |
Definition at line 26 of file qgsnetworkcontentfetcher.cpp.
void QgsNetworkContentFetcher::cancel | ( | ) |
Cancels any ongoing request.
Definition at line 86 of file qgsnetworkcontentfetcher.cpp.
QString QgsNetworkContentFetcher::contentAsString | ( | ) | const |
Returns the fetched content as a string.
Definition at line 72 of file qgsnetworkcontentfetcher.cpp.
|
signal |
Emitted when data is received.
void QgsNetworkContentFetcher::fetchContent | ( | const QUrl & | url | ) |
Fetches content from a remote URL and handles redirects.
The finished() signal will be emitted when content has been fetched.
url | URL to fetch |
Definition at line 39 of file qgsnetworkcontentfetcher.cpp.
void QgsNetworkContentFetcher::fetchContent | ( | const QNetworkRequest & | request | ) |
Fetches content using a network request and handles redirects.
The finished() signal will be emitted when content has been fetched.
Definition at line 44 of file qgsnetworkcontentfetcher.cpp.
|
signal |
Emitted when content has loaded.
QNetworkReply * QgsNetworkContentFetcher::reply | ( | ) |
Returns a reference to the network reply.
Definition at line 62 of file qgsnetworkcontentfetcher.cpp.