QGIS API Documentation 3.39.0-Master (9ea1ddbe645)
|
Registry of available annotation item types. More...
#include <qgsannotationitemregistry.h>
Signals | |
void | typeAdded (const QString &type, const QString &name) |
Emitted whenever a new item type is added to the registry, with the specified type and visible name. | |
Public Member Functions | |
QgsAnnotationItemRegistry (const QgsAnnotationItemRegistry &rh)=delete | |
QgsAnnotationItemRegistry (QObject *parent=nullptr) | |
Creates a new empty item registry. | |
~QgsAnnotationItemRegistry () override | |
bool | addItemType (QgsAnnotationItemAbstractMetadata *metadata) |
Registers a new annotation item type. | |
QgsAnnotationItem * | createItem (const QString &type) const |
Creates a new instance of a annotation item given the item type. | |
QgsAnnotationItemAbstractMetadata * | itemMetadata (const QString &type) const |
Returns the metadata for the specified item type. | |
QMap< QString, QString > | itemTypes () const |
Returns a map of available item types to translated name. | |
QgsAnnotationItemRegistry & | operator= (const QgsAnnotationItemRegistry &rh)=delete |
bool | populate () |
Populates the registry with standard item types. | |
Registry of available annotation item types.
QgsAnnotationItemRegistry is not usually directly created, but rather accessed through QgsApplication::annotationItemRegistry().
A companion class, QgsAnnotationItemGuiRegistry, handles the GUI behavior of annotation items.
Definition at line 142 of file qgsannotationitemregistry.h.
QgsAnnotationItemRegistry::QgsAnnotationItemRegistry | ( | QObject * | parent = nullptr | ) |
Creates a new empty item registry.
QgsAnnotationItemRegistry is not usually directly created, but rather accessed through QgsApplication::annotationItemRegistry().
Definition at line 28 of file qgsannotationitemregistry.cpp.
|
override |
Definition at line 33 of file qgsannotationitemregistry.cpp.
|
delete |
bool QgsAnnotationItemRegistry::addItemType | ( | QgsAnnotationItemAbstractMetadata * | metadata | ) |
Registers a new annotation item type.
Takes ownership of the metadata instance.
Definition at line 65 of file qgsannotationitemregistry.cpp.
QgsAnnotationItem * QgsAnnotationItemRegistry::createItem | ( | const QString & | type | ) | const |
Creates a new instance of a annotation item given the item type.
Definition at line 75 of file qgsannotationitemregistry.cpp.
QgsAnnotationItemAbstractMetadata * QgsAnnotationItemRegistry::itemMetadata | ( | const QString & | type | ) | const |
Returns the metadata for the specified item type.
Returns nullptr
if a corresponding type was not found in the registry.
Definition at line 60 of file qgsannotationitemregistry.cpp.
QMap< QString, QString > QgsAnnotationItemRegistry::itemTypes | ( | ) | const |
Returns a map of available item types to translated name.
Definition at line 83 of file qgsannotationitemregistry.cpp.
|
delete |
bool QgsAnnotationItemRegistry::populate | ( | ) |
Populates the registry with standard item types.
If called on a non-empty registry then this will have no effect and will return false
.
Definition at line 38 of file qgsannotationitemregistry.cpp.
|
signal |
Emitted whenever a new item type is added to the registry, with the specified type and visible name.