|
QGIS API Documentation 3.99.0-Master (26c88405ac0)
|
Template class for storage of a set of objects attached to a QgsProject. More...
#include <qgsprojectstoredobjectmanager.h>

Public Member Functions | |
| QgsAbstractProjectStoredObjectManager (QgsProject *project=nullptr) | |
| Constructor for QgsAbstractProjectStoredObjectManager, for objects attached to the specified project. | |
| ~QgsAbstractProjectStoredObjectManager () override | |
| T * | objectByName (const QString &name) const |
Returns the object with a matching name, or nullptr if no matching objects were found. | |
| QList< T * > | 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. | |
Protected Member Functions | |
| bool | addObject (T *object) |
| Adds an object to the manager. | |
| void | clearObjects () |
| Removes and deletes all objects from the manager. | |
| bool | removeObject (T *object) |
| Removes an object from the manager. | |
| virtual void | setupObjectConnections (T *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 | |
| QList< T * > | mObjects |
| Attached objects, owned by the manager. | |
| Protected Attributes inherited from QgsProjectStoredObjectManagerBase | |
| QgsProject * | mProject = nullptr |
| Associated project. | |
Additional Inherited Members | |
| 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. | |
Template class for storage of a set of objects attached to a QgsProject.
QgsAbstractProjectStoredObjectManager handles the storage, serializing and deserializing of attached objects.
QgsAbstractProjectStoredObjectManager retains ownership of all the objects contained in the manager.
Definition at line 91 of file qgsprojectstoredobjectmanager.h.
|
explicit |
Constructor for QgsAbstractProjectStoredObjectManager, for objects attached to the specified project.
Definition at line 43 of file qgsprojectstoredobjectmanager.cpp.
|
override |
Definition at line 50 of file qgsprojectstoredobjectmanager.cpp.
|
protected |
Adds an object to the manager.
Ownership of the object is transferred to the manager. Returns true if the addition was successful, or false if the object could not be added (eg as a result of a duplicate object name).
Definition at line 84 of file qgsprojectstoredobjectmanager.cpp.
|
protected |
Removes and deletes all objects from the manager.
Definition at line 74 of file qgsprojectstoredobjectmanager.cpp.
| T * QgsAbstractProjectStoredObjectManager< T >::objectByName | ( | const QString & | name | ) | const |
Returns the object with a matching name, or nullptr if no matching objects were found.
Definition at line 63 of file qgsprojectstoredobjectmanager.cpp.
| QList< T * > QgsAbstractProjectStoredObjectManager< T >::objects | ( | ) | const |
Returns the list of objects contained within the manager.
Definition at line 57 of file qgsprojectstoredobjectmanager.cpp.
|
protected |
Removes an object from the manager.
The object is deleted. Returns true if the removal was successful, or false if the removal failed (eg as a result of removing an object which is not contained in the manager).
Definition at line 110 of file qgsprojectstoredobjectmanager.cpp.
|
protectedvirtual |
Sets up additional connections to an object, called when the object is first added to the manager.
Definition at line 128 of file qgsprojectstoredobjectmanager.cpp.
|
protected |
Attached objects, owned by the manager.
Definition at line 116 of file qgsprojectstoredobjectmanager.h.