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.

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

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

setAboutToBeAdded

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

setAboutToBeRemoved

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

setAdded

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

setRemoved

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

setRenamed

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

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]

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.

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[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.

signal setAboutToBeRemoved[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.

signal setAdded[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.

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[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.

signal setRenamed[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.

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