QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
QgsAnnotationItemGuiMetadata Class Reference

Convenience metadata class that uses static functions to handle annotation item GUI behavior. More...

#include <qgsannotationitemguiregistry.h>

Inheritance diagram for QgsAnnotationItemGuiMetadata:
Inheritance graph
[legend]

Public Member Functions

 QgsAnnotationItemGuiMetadata (const QString &type, const QString &visibleName, const QIcon &creationIcon, const QgsAnnotationItemWidgetFunc &pfWidget=nullptr, const QString &groupId=QString(), Qgis::AnnotationItemGuiFlags flags=Qgis::AnnotationItemGuiFlags(), const QgsAnnotationItemCreateFunc &pfCreateFunc=nullptr, const QgsCreateAnnotationItemMapToolFunc &pfCreateMapToolFunc=nullptr)
 Constructor for QgsAnnotationItemGuiMetadata with the specified class type and creationIcon, and function pointers for the various configuration widget creation functions.
 
QgsAnnotationItemcreateItem () override
 Creates an instance of the corresponding item type.
 
QgsAnnotationItemBaseWidgetcreateItemWidget (QgsAnnotationItem *item) override
 Creates a configuration widget for an item of this type.
 
QgsCreateAnnotationItemMapToolInterfacecreateMapTool (QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget) override
 Creates a map tool for a creating a new item of this type.
 
QgsCreateAnnotationItemMapToolFunc createMapToolFunction () const
 Returns the classes' create new item map tool creation function.
 
QIcon creationIcon () const override
 Returns an icon representing creation of the annotation item type.
 
QgsAnnotationItemAddedToLayerFunc itemAddToLayerFunction () const
 Returns the classes' item added to layer function.
 
QgsAnnotationItemCreateFunc itemCreationFunction () const
 Returns the classes' item creation function.
 
void newItemAddedToLayer (QgsAnnotationItem *item, QgsAnnotationLayer *layer) override
 Called when a newly created item of the associated type has been added to a layer.
 
void setCreateMapToolFunction (const QgsCreateAnnotationItemMapToolFunc &function)
 Sets the classes' create new item map tool creation function.
 
void setItemAddedToLayerFunction (const QgsAnnotationItemAddedToLayerFunc &function)
 Sets the classes' item creation function.
 
void setItemCreationFunction (const QgsAnnotationItemCreateFunc &function)
 Sets the classes' item creation function.
 
void setWidgetFunction (const QgsAnnotationItemWidgetFunc &function)
 Sets the classes' configuration widget creation function.
 
QgsAnnotationItemWidgetFunc widgetFunction () const
 Returns the classes' configuration widget creation function.
 

Protected Attributes

QgsAnnotationItemAddedToLayerFunc mAddedToLayerFunc = nullptr
 
QgsAnnotationItemCreateFunc mCreateFunc = nullptr
 
QgsCreateAnnotationItemMapToolFunc mCreateMapToolFunc = nullptr
 
QIcon mIcon
 
QgsAnnotationItemWidgetFunc mWidgetFunc = nullptr
 

Detailed Description

Convenience metadata class that uses static functions to handle annotation item GUI behavior.

Note
not available in Python bindings
Since
QGIS 3.22

Definition at line 156 of file qgsannotationitemguiregistry.h.

Constructor & Destructor Documentation

◆ QgsAnnotationItemGuiMetadata()

QgsAnnotationItemGuiMetadata::QgsAnnotationItemGuiMetadata ( const QString &  type,
const QString &  visibleName,
const QIcon &  creationIcon,
const QgsAnnotationItemWidgetFunc pfWidget = nullptr,
const QString &  groupId = QString(),
Qgis::AnnotationItemGuiFlags  flags = Qgis::AnnotationItemGuiFlags(),
const QgsAnnotationItemCreateFunc pfCreateFunc = nullptr,
const QgsCreateAnnotationItemMapToolFunc pfCreateMapToolFunc = nullptr 
)
inline

Constructor for QgsAnnotationItemGuiMetadata with the specified class type and creationIcon, and function pointers for the various configuration widget creation functions.

visibleName should be set to a translated, user visible name identifying the corresponding annotation item.

An optional groupId can be set, which allows grouping of related annotation item classes. See QgsAnnotationItemGuiMetadata for details.

Definition at line 169 of file qgsannotationitemguiregistry.h.

Member Function Documentation

◆ createItem()

QgsAnnotationItem * QgsAnnotationItemGuiMetadata::createItem ( )
overridevirtual

Creates an instance of the corresponding item type.

Reimplemented from QgsAnnotationItemAbstractGuiMetadata.

Definition at line 70 of file qgsannotationitemguiregistry.cpp.

◆ createItemWidget()

QgsAnnotationItemBaseWidget * QgsAnnotationItemGuiMetadata::createItemWidget ( QgsAnnotationItem item)
overridevirtual

Creates a configuration widget for an item of this type.

Can return nullptr if no configuration GUI is required.

Reimplemented from QgsAnnotationItemAbstractGuiMetadata.

Definition at line 65 of file qgsannotationitemguiregistry.cpp.

◆ createMapTool()

QgsCreateAnnotationItemMapToolInterface * QgsAnnotationItemGuiMetadata::createMapTool ( QgsMapCanvas canvas,
QgsAdvancedDigitizingDockWidget cadDockWidget 
)
overridevirtual

Creates a map tool for a creating a new item of this type.

May return nullptr if no map tool is available for creating the item.

Reimplemented from QgsAnnotationItemAbstractGuiMetadata.

Definition at line 81 of file qgsannotationitemguiregistry.cpp.

◆ createMapToolFunction()

QgsCreateAnnotationItemMapToolFunc QgsAnnotationItemGuiMetadata::createMapToolFunction ( ) const
inline

Returns the classes' create new item map tool creation function.

See also
setCreateMapToolFunction()

Definition at line 198 of file qgsannotationitemguiregistry.h.

◆ creationIcon()

QIcon QgsAnnotationItemGuiMetadata::creationIcon ( ) const
overridevirtual

Returns an icon representing creation of the annotation item type.

Reimplemented from QgsAnnotationItemAbstractGuiMetadata.

Definition at line 60 of file qgsannotationitemguiregistry.cpp.

◆ itemAddToLayerFunction()

QgsAnnotationItemAddedToLayerFunc QgsAnnotationItemGuiMetadata::itemAddToLayerFunction ( ) const
inline

Returns the classes' item added to layer function.

See also
setItemAddedToLayerFunction()

Definition at line 222 of file qgsannotationitemguiregistry.h.

◆ itemCreationFunction()

QgsAnnotationItemCreateFunc QgsAnnotationItemGuiMetadata::itemCreationFunction ( ) const
inline

Returns the classes' item creation function.

See also
setItemCreationFunction()

Definition at line 210 of file qgsannotationitemguiregistry.h.

◆ newItemAddedToLayer()

void QgsAnnotationItemGuiMetadata::newItemAddedToLayer ( QgsAnnotationItem item,
QgsAnnotationLayer layer 
)
overridevirtual

Called when a newly created item of the associated type has been added to a layer.

This is only called for additions which result from GUI operations - i.e. it is not called for items added programmatically.

Reimplemented from QgsAnnotationItemAbstractGuiMetadata.

Definition at line 75 of file qgsannotationitemguiregistry.cpp.

◆ setCreateMapToolFunction()

void QgsAnnotationItemGuiMetadata::setCreateMapToolFunction ( const QgsCreateAnnotationItemMapToolFunc function)
inline

Sets the classes' create new item map tool creation function.

See also
createMapToolFunction()

Definition at line 204 of file qgsannotationitemguiregistry.h.

◆ setItemAddedToLayerFunction()

void QgsAnnotationItemGuiMetadata::setItemAddedToLayerFunction ( const QgsAnnotationItemAddedToLayerFunc function)
inline

Sets the classes' item creation function.

See also
itemAddToLayerFunction()

Definition at line 228 of file qgsannotationitemguiregistry.h.

◆ setItemCreationFunction()

void QgsAnnotationItemGuiMetadata::setItemCreationFunction ( const QgsAnnotationItemCreateFunc function)
inline

Sets the classes' item creation function.

See also
itemCreationFunction()

Definition at line 216 of file qgsannotationitemguiregistry.h.

◆ setWidgetFunction()

void QgsAnnotationItemGuiMetadata::setWidgetFunction ( const QgsAnnotationItemWidgetFunc function)
inline

Sets the classes' configuration widget creation function.

See also
widgetFunction()

Definition at line 192 of file qgsannotationitemguiregistry.h.

◆ widgetFunction()

QgsAnnotationItemWidgetFunc QgsAnnotationItemGuiMetadata::widgetFunction ( ) const
inline

Returns the classes' configuration widget creation function.

See also
setWidgetFunction()

Definition at line 186 of file qgsannotationitemguiregistry.h.

Member Data Documentation

◆ mAddedToLayerFunc

QgsAnnotationItemAddedToLayerFunc QgsAnnotationItemGuiMetadata::mAddedToLayerFunc = nullptr
protected

Definition at line 242 of file qgsannotationitemguiregistry.h.

◆ mCreateFunc

QgsAnnotationItemCreateFunc QgsAnnotationItemGuiMetadata::mCreateFunc = nullptr
protected

Definition at line 240 of file qgsannotationitemguiregistry.h.

◆ mCreateMapToolFunc

QgsCreateAnnotationItemMapToolFunc QgsAnnotationItemGuiMetadata::mCreateMapToolFunc = nullptr
protected

Definition at line 241 of file qgsannotationitemguiregistry.h.

◆ mIcon

QIcon QgsAnnotationItemGuiMetadata::mIcon
protected

Definition at line 238 of file qgsannotationitemguiregistry.h.

◆ mWidgetFunc

QgsAnnotationItemWidgetFunc QgsAnnotationItemGuiMetadata::mWidgetFunc = nullptr
protected

Definition at line 239 of file qgsannotationitemguiregistry.h.


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