Class: QgsSelectiveMaskingSourceSetManager

Manages storage of a set of selective masking source sets.

QgsSelectiveMaskingSourceSetManager handles the storage, serializing and deserializing of selective masking source sets. Usually this class is not constructed directly, but rather accessed through a QgsProject via QgsProject.selectiveMaskingSourceSetManager().

QgsSelectiveMaskingSourceSetManager retains ownership of all the sets contained in the manager.

Added in version 4.0.

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.core.QgsSelectiveMaskingSourceSetManager

Base classes

QgsProjectStoredObjectManagerBase

Manages storage of a set of objects attached to a QgsProject.

QObject

Methods

addSet

Adds a set to the manager.

clear

Removes and deletes all sets from the manager.

generateUniqueTitle

Generates a unique title for a new set, which does not clash with any already contained by the manager.

readXml

Reads the manager's state from a DOM element, restoring all sets present in the XML document.

removeSet

Removes the set with matching name from the manager.

renameSet

Renames a set in the manager from oldName to newName.

setById

Returns the set with a matching id, or an invalid set if no matching sets were found.

setByName

Returns the set with a matching name, or an invalid set if no matching sets were found.

sets

Returns a list of all sets contained in the manager.

updateSet

Updates the definition of a set already in the manager.

writeXml

Returns a DOM element representing the state of the manager.

Signals

changed

Emitted whenever sets stored within the manager are changed

setAboutToBeAdded

Emitted when a set is about to be added to the manager

setAboutToBeRemoved

Emitted when a set is about to be removed from the manager

setAdded

Emitted when a set has been added to the manager

setRemoved

Emitted when a set was removed from the manager

setRenamed

Emitted when a set is renamed

class qgis.core.QgsSelectiveMaskingSourceSetManager[source]

Bases: QgsProjectStoredObjectManagerBase

__init__(project: QgsProject | None = None)

Constructor for QgsSelectiveMaskingSourceSetManager. The project will become the parent object for this manager.

Parameters:

project (Optional[QgsProject] = None)

addSet(self, set: QgsSelectiveMaskingSourceSet) bool[source]

Adds a set to the manager.

Returns True if the addition was successful, or False if the set could not be added (eg as a result of a duplicate set name).

See also

removeSet()

See also

setAdded()

Parameters:

set (QgsSelectiveMaskingSourceSet)

Return type:

bool

signal changed[source]

Emitted whenever sets stored within the manager are changed

clear(self)[source]

Removes and deletes all sets from the manager.

See also

removeSet()

generateUniqueTitle(self) str[source]

Generates a unique title for a new set, which does not clash with any already contained by the manager.

Return type:

str

readXml(self, element: QDomElement, doc: QDomDocument, context: QgsReadWriteContext) bool[source]

Reads the manager’s state from a DOM element, restoring all sets present in the XML document.

See also

writeXml()

Parameters:
Return type:

bool

removeSet(self, name: str | None) bool[source]

Removes the set with matching name from the manager.

Returns True if the removal was successful, or False if the removal failed (eg as a result of removing a set which is not contained in the manager).

See also

addSet()

See also

setRemoved()

See also

clear()

Parameters:

name (Optional[str])

Return type:

bool

renameSet(self, oldName: str | None, newName: str | None) bool[source]

Renames a set in the manager from oldName to newName.

Returns True if the rename was successful, or False if it failed (eg no set existed with matching name, or a duplicate new name was used).

Parameters:
Return type:

bool

signal setAboutToBeAdded(name: str)[source]

Emitted when a set is about to be added to the manager

Parameters:

name (str)

signal setAboutToBeRemoved(name: str)[source]

Emitted when a set is about to be removed from the manager

Parameters:

name (str)

signal setAdded(name: str)[source]

Emitted when a set has been added to the manager

Parameters:

name (str)

setById(self, id: str | None) QgsSelectiveMaskingSourceSet[source]

Returns the set with a matching id, or an invalid set if no matching sets were found.

Parameters:

id (Optional[str])

Return type:

QgsSelectiveMaskingSourceSet

setByName(self, name: str | None) QgsSelectiveMaskingSourceSet[source]

Returns the set with a matching name, or an invalid set if no matching sets were found.

Parameters:

name (Optional[str])

Return type:

QgsSelectiveMaskingSourceSet

signal setRemoved(name: str)[source]

Emitted when a set was removed from the manager

Parameters:

name (str)

signal setRenamed(oldName: str, newName: str)[source]

Emitted when a set is renamed

Parameters:
  • oldName (str)

  • newName (str)

sets(self) list[QgsSelectiveMaskingSourceSet]

Returns a list of all sets contained in the manager.

Return type:

list[QgsSelectiveMaskingSourceSet]

updateSet(self, set: QgsSelectiveMaskingSourceSet) bool[source]

Updates the definition of a set already in the manager.

The definition of the existing set with matching ID will be replaced with the updated set.

Parameters:

set (QgsSelectiveMaskingSourceSet)

Return type:

bool

writeXml(self, doc: QDomDocument, context: QgsReadWriteContext) QDomElement[source]

Returns a DOM element representing the state of the manager.

See also

readXml()

Parameters:
Return type:

QDomElement