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  | 
Methods
Runs additional checks on a network reply to ensure that the reply content is consistent with that required by the cache.  | 
|
Triggered after remote content (i.e. HTTP linked content at the given url) has been fetched.  | 
Static Methods
Returns   | 
|
Parses a path to determine if it represents a base 64 encoded HTML data URL, and if so, extracts the components of the URL.  | 
|
Parses a path to determine if it represents a embedded string data, and if so, extracts the components of the URL.  | 
Signals
Emitted when the cache has finished retrieving content from a remote url.  | 
- class qgis.core.QgsAbstractContentCacheBase[source]¶
 Bases:
QObject- __init__(parent: QObject | None)
 Constructor for QgsAbstractContentCacheBase, with the specified
parentobject.- Parameters:
 parent (Optional[QObject])
- 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
- static isBase64Data(path: str | None) bool[source]¶
 Returns
Trueifpathrepresents base64 encoded data.Added in version 3.40.
- Parameters:
 path (Optional[str])
- Return type:
 bool
- 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.