Class: QgsStringReplacementCollection¶
-
class
qgis.core.
QgsStringReplacementCollection
(replacements: Iterable[QgsStringReplacement] = [])¶ Bases:
sip.wrapper
Constructor for QgsStringReplacementCollection
- Parameters
replacements – initial list of string replacements
QgsStringReplacementCollection(QgsStringReplacementCollection)
A collection of string replacements (specified using QgsStringReplacement objects).
New in version 3.0: Enums
Methods
Processes a given input string, applying any valid replacements which should be made using QgsStringReplacement objects contained by this collection.
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.
Signals
Attributes
-
process
(self, input: str) → str¶ Processes a given input string, applying any valid replacements which should be made using QgsStringReplacement objects contained by this collection. Replacements are made in order of the QgsStringReplacement objects contained in the collection.
- Parameters
input – input string
- Returns
input string with any matches replaced by replacement string
-
readXml
(self, elem: QDomElement)¶ Reads the collection state from an XML element.
- Parameters
elem – DOM element
See also
-
replacements
(self) → List[QgsStringReplacement]¶ Returns the list of string replacements in this collection.
See also
-
setReplacements
(self, replacements: Iterable[QgsStringReplacement])¶ Sets the list of string replacements in this collection.
- Parameters
replacements – list of string replacements to apply. Replacements are applied in the order they are specified here.
See also