Subgroup: Network

Class: QgsNetworkContentFetcherTask

class qgis.core.QgsNetworkContentFetcherTask(url: QUrl)

Bases: qgis._core.QgsTask

Constructor for a QgsNetworkContentFetcherTask which fetches the specified url.

QgsNetworkContentFetcherTask(request: QNetworkRequest) Constructor for a QgsNetworkContentFetcherTask which fetches the specified network request.

Handles HTTP network content fetching in a background task.

Provides a simple method for fetching remote HTTP content in a QgsTask. Url redirects are automatically handled.

After constructing a QgsNetworkContentFetcherTask, callers should connect to the QgsNetworkContentFetcherTask.fetched signal. They can then safely access the network reply() from the connected slot without danger of the task being first removed by the QgsTaskManager.

New in version 3.2: Methods

cancel
childEvent
connectNotify
customEvent
disconnectNotify
finished
isCanceled
isSignalConnected
receivers
reply Returns the network reply.
run
sender
senderSignalIndex
setProgress
timerEvent

Signals

fetched Emitted when the network content has been fetched, regardless of whether the fetch was successful or not.

Attributes

cancel(self)
childEvent()
connectNotify()
customEvent()
disconnectNotify()
fetched

Emitted when the network content has been fetched, regardless of whether the fetch was successful or not.

Users of QgsNetworkContentFetcherTask should connect to this signal, and from the associated slot they can then safely access the network reply() without danger of the task being first removed by the QgsTaskManager. [signal]

finished()
isCanceled()
isSignalConnected()
receivers()
reply(self) → QNetworkReply

Returns the network reply. Ownership is not transferred.

May return None if the request has not yet completed.

run(self) → bool
sender()
senderSignalIndex()
setProgress()
timerEvent()