QGIS API Documentation 3.41.0-Master (d5b93354e9c)
Loading...
Searching...
No Matches
Signals | Public Member Functions | List of all members
QgsAnnotationItemRegistry Class Reference

Registry of available annotation item types. More...

#include <qgsannotationitemregistry.h>

Inheritance diagram for QgsAnnotationItemRegistry:
Inheritance graph
[legend]

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.
 
QgsAnnotationItemcreateItem (const QString &type) const
 Creates a new instance of a annotation item given the item type.
 
QgsAnnotationItemAbstractMetadataitemMetadata (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.
 
QgsAnnotationItemRegistryoperator= (const QgsAnnotationItemRegistry &rh)=delete
 
bool populate ()
 Populates the registry with standard item types.
 

Detailed Description

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.

Since
QGIS 3.16

Definition at line 142 of file qgsannotationitemregistry.h.

Constructor & Destructor Documentation

◆ QgsAnnotationItemRegistry() [1/2]

QgsAnnotationItemRegistry::QgsAnnotationItemRegistry ( QObject *  parent = nullptr)

Creates a new empty item registry.

QgsAnnotationItemRegistry is not usually directly created, but rather accessed through QgsApplication::annotationItemRegistry().

See also
populate()

Definition at line 29 of file qgsannotationitemregistry.cpp.

◆ ~QgsAnnotationItemRegistry()

QgsAnnotationItemRegistry::~QgsAnnotationItemRegistry ( )
override

Definition at line 34 of file qgsannotationitemregistry.cpp.

◆ QgsAnnotationItemRegistry() [2/2]

QgsAnnotationItemRegistry::QgsAnnotationItemRegistry ( const QgsAnnotationItemRegistry rh)
delete

Member Function Documentation

◆ addItemType()

bool QgsAnnotationItemRegistry::addItemType ( QgsAnnotationItemAbstractMetadata metadata)

Registers a new annotation item type.

Takes ownership of the metadata instance.

Definition at line 66 of file qgsannotationitemregistry.cpp.

◆ createItem()

QgsAnnotationItem * QgsAnnotationItemRegistry::createItem ( const QString &  type) const

Creates a new instance of a annotation item given the item type.

Definition at line 76 of file qgsannotationitemregistry.cpp.

◆ itemMetadata()

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 61 of file qgsannotationitemregistry.cpp.

◆ itemTypes()

QMap< QString, QString > QgsAnnotationItemRegistry::itemTypes ( ) const

Returns a map of available item types to translated name.

Definition at line 84 of file qgsannotationitemregistry.cpp.

◆ operator=()

QgsAnnotationItemRegistry & QgsAnnotationItemRegistry::operator= ( const QgsAnnotationItemRegistry rh)
delete

◆ populate()

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 39 of file qgsannotationitemregistry.cpp.

◆ typeAdded

void QgsAnnotationItemRegistry::typeAdded ( const QString &  type,
const QString &  name 
)
signal

Emitted whenever a new item type is added to the registry, with the specified type and visible name.


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