QGIS API Documentation 3.99.0-Master (e9821da5c6b)
Loading...
Searching...
No Matches
QgsSelectiveMaskingSourceSetManager Class Reference

Manages storage of a set of selective masking source sets. More...

#include <qgsselectivemaskingsourcesetmanager.h>

Inheritance diagram for QgsSelectiveMaskingSourceSetManager:

Signals

void changed ()
 Emitted whenever sets stored within the manager are changed.
void setAboutToBeAdded (const QString &name)
 Emitted when a set is about to be added to the manager.
void setAboutToBeRemoved (const QString &name)
 Emitted when a set is about to be removed from the manager.
void setAdded (const QString &name)
 Emitted when a set has been added to the manager.
void setRemoved (const QString &name)
 Emitted when a set was removed from the manager.
void setRenamed (const QString &oldName, const QString &newName)
 Emitted when a set is renamed.
Signals inherited from QgsProjectStoredObjectManagerBase
void objectAboutToBeAdded (const QString &name)
 Emitted when an object is about to be added to the manager.
void objectAboutToBeRemoved (const QString &name)
 Emitted when an object is about to be removed from the manager.
void objectAdded (const QString &name)
 Emitted when an object has been added to the manager.
void objectRemoved (const QString &name)
 Emitted when an object was removed from the manager.

Public Member Functions

 QgsSelectiveMaskingSourceSetManager (QgsProject *project=nullptr)
 Constructor for QgsSelectiveMaskingSourceSetManager.
 ~QgsSelectiveMaskingSourceSetManager () override
bool addSet (const QgsSelectiveMaskingSourceSet &set)
 Adds a set to the manager.
void clear ()
 Removes and deletes all sets from the manager.
QString generateUniqueTitle () const
 Generates a unique title for a new set, which does not clash with any already contained by the manager.
bool readXml (const QDomElement &element, const QDomDocument &doc, const QgsReadWriteContext &context)
 Reads the manager's state from a DOM element, restoring all sets present in the XML document.
bool removeSet (const QString &name)
 Removes the set with matching name from the manager.
bool renameSet (const QString &oldName, const QString &newName)
 Renames a set in the manager from oldName to newName.
QgsSelectiveMaskingSourceSet setById (const QString &id) const
 Returns the set with a matching id, or an invalid set if no matching sets were found.
QgsSelectiveMaskingSourceSet setByName (const QString &name) const
 Returns the set with a matching name, or an invalid set if no matching sets were found.
QVector< QgsSelectiveMaskingSourceSetsets () const
 Returns a list of all sets contained in the manager.
bool updateSet (const QgsSelectiveMaskingSourceSet &set)
 Updates the definition of a set already in the manager.
QDomElement writeXml (QDomDocument &doc, const QgsReadWriteContext &context) const
 Returns a DOM element representing the state of the manager.
Public Member Functions inherited from QgsAbstractProjectStoredObjectManager< QgsSelectiveMaskingSourceSet >
 QgsAbstractProjectStoredObjectManager (QgsProject *project=nullptr)
 Constructor for QgsAbstractProjectStoredObjectManager, for objects attached to the specified project.
 ~QgsAbstractProjectStoredObjectManager () override
QgsSelectiveMaskingSourceSetobjectByName (const QString &name) const
 Returns the object with a matching name, or nullptr if no matching objects were found.
QList< QgsSelectiveMaskingSourceSet * > objects () const
 Returns the list of objects contained within the manager.
Public Member Functions inherited from QgsProjectStoredObjectManagerBase
 QgsProjectStoredObjectManagerBase (QgsProject *project=nullptr)
 Constructor for QgsProjectStoredObjectManagerBase, for objects attached to the specified project.

Additional Inherited Members

Protected Member Functions inherited from QgsAbstractProjectStoredObjectManager< QgsSelectiveMaskingSourceSet >
bool addObject (QgsSelectiveMaskingSourceSet *object)
 Adds an object to the manager.
void clearObjects ()
 Removes and deletes all objects from the manager.
bool removeObject (QgsSelectiveMaskingSourceSet *object)
 Removes an object from the manager.
virtual void setupObjectConnections (QgsSelectiveMaskingSourceSet *object)
 Sets up additional connections to an object, called when the object is first added to the manager.
Protected Member Functions inherited from QgsProjectStoredObjectManagerBase
void markProjectDirty ()
 Marks the project as dirty.
Protected Attributes inherited from QgsAbstractProjectStoredObjectManager< QgsSelectiveMaskingSourceSet >
QList< QgsSelectiveMaskingSourceSet * > mObjects
 Attached objects, owned by the manager.
Protected Attributes inherited from QgsProjectStoredObjectManagerBase
QgsProjectmProject = nullptr
 Associated project.

Detailed Description

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.

Since
QGIS 4.0

Definition at line 49 of file qgsselectivemaskingsourcesetmanager.h.

Constructor & Destructor Documentation

◆ QgsSelectiveMaskingSourceSetManager()

QgsSelectiveMaskingSourceSetManager::QgsSelectiveMaskingSourceSetManager ( QgsProject * project = nullptr)
explicit

Constructor for QgsSelectiveMaskingSourceSetManager.

The project will become the parent object for this manager.

Definition at line 28 of file qgsselectivemaskingsourcesetmanager.cpp.

◆ ~QgsSelectiveMaskingSourceSetManager()

QgsSelectiveMaskingSourceSetManager::~QgsSelectiveMaskingSourceSetManager ( )
override

Definition at line 40 of file qgsselectivemaskingsourcesetmanager.cpp.

Member Function Documentation

◆ addSet()

bool QgsSelectiveMaskingSourceSetManager::addSet ( const QgsSelectiveMaskingSourceSet & set)

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()
setAdded()

Definition at line 45 of file qgsselectivemaskingsourcesetmanager.cpp.

◆ changed

void QgsSelectiveMaskingSourceSetManager::changed ( )
signal

Emitted whenever sets stored within the manager are changed.

◆ clear()

void QgsSelectiveMaskingSourceSetManager::clear ( )

Removes and deletes all sets from the manager.

See also
removeSet()

Definition at line 76 of file qgsselectivemaskingsourcesetmanager.cpp.

◆ generateUniqueTitle()

QString QgsSelectiveMaskingSourceSetManager::generateUniqueTitle ( ) const

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

Definition at line 173 of file qgsselectivemaskingsourcesetmanager.cpp.

◆ readXml()

bool QgsSelectiveMaskingSourceSetManager::readXml ( const QDomElement & element,
const QDomDocument & doc,
const QgsReadWriteContext & context )

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

See also
writeXml()

Definition at line 125 of file qgsselectivemaskingsourcesetmanager.cpp.

◆ removeSet()

bool QgsSelectiveMaskingSourceSetManager::removeSet ( const QString & name)

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()
setRemoved()
setAboutToBeRemoved()
clear()

Definition at line 67 of file qgsselectivemaskingsourcesetmanager.cpp.

◆ renameSet()

bool QgsSelectiveMaskingSourceSetManager::renameSet ( const QString & oldName,
const QString & newName )

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

Definition at line 81 of file qgsselectivemaskingsourcesetmanager.cpp.

◆ setAboutToBeAdded

void QgsSelectiveMaskingSourceSetManager::setAboutToBeAdded ( const QString & name)
signal

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

◆ setAboutToBeRemoved

void QgsSelectiveMaskingSourceSetManager::setAboutToBeRemoved ( const QString & name)
signal

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

◆ setAdded

void QgsSelectiveMaskingSourceSetManager::setAdded ( const QString & name)
signal

Emitted when a set has been added to the manager.

◆ setById()

QgsSelectiveMaskingSourceSet QgsSelectiveMaskingSourceSetManager::setById ( const QString & id) const

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

Definition at line 106 of file qgsselectivemaskingsourcesetmanager.cpp.

◆ setByName()

QgsSelectiveMaskingSourceSet QgsSelectiveMaskingSourceSetManager::setByName ( const QString & name) const

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

Definition at line 116 of file qgsselectivemaskingsourcesetmanager.cpp.

◆ setRemoved

void QgsSelectiveMaskingSourceSetManager::setRemoved ( const QString & name)
signal

Emitted when a set was removed from the manager.

◆ setRenamed

void QgsSelectiveMaskingSourceSetManager::setRenamed ( const QString & oldName,
const QString & newName )
signal

Emitted when a set is renamed.

◆ sets()

QVector< QgsSelectiveMaskingSourceSet > QgsSelectiveMaskingSourceSetManager::sets ( ) const

Returns a list of all sets contained in the manager.

Definition at line 95 of file qgsselectivemaskingsourcesetmanager.cpp.

◆ updateSet()

bool QgsSelectiveMaskingSourceSetManager::updateSet ( const QgsSelectiveMaskingSourceSet & set)

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.

Definition at line 50 of file qgsselectivemaskingsourcesetmanager.cpp.

◆ writeXml()

QDomElement QgsSelectiveMaskingSourceSetManager::writeXml ( QDomDocument & doc,
const QgsReadWriteContext & context ) const

Returns a DOM element representing the state of the manager.

See also
readXml()

Definition at line 162 of file qgsselectivemaskingsourcesetmanager.cpp.


The documentation for this class was generated from the following files: