Class: QgsFetchedContent¶
- class qgis.core.QgsFetchedContent¶
Bases:
PyQt5.QtCore.QObject
FetchedContent holds useful information about a network content being fetched
See also
New in version 3.2.
QgsFetchedContent(url: str, file: QTemporaryFile = None, status: QgsFetchedContent.ContentStatus = QgsFetchedContent.NotStarted, authConfig: str = ‘’) Constructs a FetchedContent with pointer to the downloaded file and status of the download
Methods
Returns the authentication configuration id use for this fetched content
Cancel the download operation.
Start the download
Returns the potential error of the download
Returns the path to the local file, an empty string if the file is not accessible yet.
Returns the status of the download
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
Attributes
- class ContentStatus¶
Bases:
int
- Downloading = 1¶
- Failed = 3¶
- Finished = 2¶
- NotStarted = 0¶
- authConfig(self) str ¶
Returns the authentication configuration id use for this fetched content
- Return type:
str
- cancel(self)¶
Cancel the download operation.
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- download(self, redownload: bool = False)¶
Start the download
- Parameters:
redownload (bool = False) – if set to
True
, it will restart any achieved or pending download.
- error(self) QNetworkReply.NetworkError ¶
Returns the potential error of the download
- Return type:
QNetworkReply.NetworkError
- errorOccurred¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- fetched¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- filePath(self) str ¶
Returns the path to the local file, an empty string if the file is not accessible yet.
- Return type:
str
- isSignalConnected(self, QMetaMethod) bool ¶
- receivers(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- status(self) QgsFetchedContent.ContentStatus ¶
Returns the status of the download
- Return type:
- timerEvent(self, QTimerEvent)¶