Class: QgsAbstractContentCacheBase¶
A QObject derived base class for QgsAbstractContentCache.
Required because template based class (such as
QgsAbstractContentCache) cannot use the Q_OBJECT macro.
Added in version 3.6.
Class Hierarchy¶
Base classes¶
Subclasses¶
A cache for images derived from raster files. |
|
A cache for source strings that returns a local file path containing the source content. |
|
A cache for images / pictures derived from SVG files. |
- class qgis.core.QgsAbstractContentCacheBase[source]¶
Bases:
QObject- __init__(parent: QObject | None)
Constructor for QgsAbstractContentCacheBase, with the specified
parentobject.- Parameters:
parent (Optional[QObject])
- virtual checkReply(self, reply: QNetworkReply | None, path: str | None) bool[source]¶
Runs additional checks on a network
replyto ensure that the reply content is consistent with that required by the cache.- Parameters:
reply (Optional[QNetworkReply])
path (Optional[str])
- Return type:
bool
- virtual invalidateCacheEntry(self, path: str | None) bool[source]¶
Invalidates a cache entry for the specified
path.If an entry exists for the given
path, it will be removed from the cache.- Parameters:
path (Optional[str]) – The path of the cache entry to invalidate.
- Return type:
bool
- Returns:
Trueif an entry was invalidated,Falseotherwise.
Added in version 3.44.
- static isBase64Data(path: str | None) bool[source]¶
Returns
Trueifpathrepresents base64 encoded data.Added in version 3.40.
- Parameters:
path (Optional[str])
- Return type:
bool
- virtual onRemoteContentFetched(self, url: str | None, success: bool)[source]¶
Triggered after remote content (i.e. HTTP linked content at the given
url) has been fetched.The
successargument will beTrueif the content was successfully fetched, orFalseif it was not fetched successfully.- Parameters:
url (Optional[str])
success (bool)
- static parseBase64DataUrl(path: str | None)[source]¶
Parses a
pathto determine if it represents a base 64 encoded HTML data URL, and if so, extracts the components of the URL.Data URLs are of the form
data:[<mediatype>;]base64,<data>.- Parameters:
path (Optional[str]) -> (bool) – path to test
- Returns:
Trueifpathis a base 64 encoded data URLmimeType: the extracted mime type if the
pathis a data URLdata: the extracted base64 data if the
pathis a data URL
Added in version 3.40.
- static parseEmbeddedStringData(path: str | None)[source]¶
Parses a
pathto determine if it represents a embedded string data, and if so, extracts the components of the URL.Data URLs are of the form
data:[<mediatype>;]utf8,<data>.- Parameters:
path (Optional[str]) -> (bool) – path to test
- Returns:
Trueifpathis an embedded string data URLmimeType: the extracted mime type if the
pathis a data URLdata: the extracted string data if the
pathis a data URL
Added in version 3.42.
- signal remoteContentFetched[source]¶
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.