Class: QgsStringReplacementCollection¶
A collection of string replacements (specified using
QgsStringReplacement objects).
Methods
Processes a given input string, applying any valid replacements which should be made using   | 
|
Reads the collection state from an XML element.  | 
|
Returns the list of string replacements in this collection.  | 
|
Sets the list of string replacements in this collection.  | 
|
Writes the collection state to an XML element.  | 
- class qgis.core.QgsStringReplacementCollection[source]¶
 Bases:
object- __init__(replacements: Iterable[QgsStringReplacement] = [])
 Constructor for QgsStringReplacementCollection
- Parameters:
 replacements (Iterable[QgsStringReplacement] = []) – initial list of string replacements
- __init__(a0: QgsStringReplacementCollection)
 - Parameters:
 
- process(self, input: str | None) str[source]¶
 Processes a given input string, applying any valid replacements which should be made using
QgsStringReplacementobjects contained by this collection. Replacements are made in order of theQgsStringReplacementobjects contained in the collection.- Parameters:
 input (Optional[str]) – input string
- Return type:
 str
- Returns:
 input string with any matches replaced by replacement string
- readXml(self, elem: QDomElement)[source]¶
 Reads the collection state from an XML element.
- Parameters:
 elem (QDomElement) – DOM element
See also
- replacements(self) List[QgsStringReplacement]¶
 Returns the list of string replacements in this collection.
See also
- Return type:
 List[QgsStringReplacement]
- setReplacements(self, replacements: Iterable[QgsStringReplacement])[source]¶
 Sets the list of string replacements in this collection.
- Parameters:
 replacements (Iterable[QgsStringReplacement]) – list of string replacements to apply. Replacements are applied in the order they are specified here.
See also