QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
Convenience metadata class that uses static functions to handle annotation item GUI behavior. More...
#include <qgsannotationitemguiregistry.h>
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. | |
QgsAnnotationItem * | createItem () override |
Creates an instance of the corresponding item type. | |
QgsAnnotationItemBaseWidget * | createItemWidget (QgsAnnotationItem *item) override |
Creates a configuration widget for an item of this type. | |
QgsCreateAnnotationItemMapToolInterface * | createMapTool (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. | |
Public Member Functions inherited from QgsAnnotationItemAbstractGuiMetadata | |
QgsAnnotationItemAbstractGuiMetadata (const QString &type, const QString &visibleName, const QString &groupId=QString(), Qgis::AnnotationItemGuiFlags flags=Qgis::AnnotationItemGuiFlags()) | |
Constructor for QgsAnnotationItemAbstractGuiMetadata with the specified class type. | |
virtual | ~QgsAnnotationItemAbstractGuiMetadata ()=default |
Qgis::AnnotationItemGuiFlags | flags () const |
Returns item flags. | |
QString | groupId () const |
Returns the item group ID, if set. | |
QString | type () const |
Returns the unique item type code for the annotation item class. | |
QString | visibleName () const |
Returns a translated, user visible name identifying the corresponding annotation item. | |
Protected Attributes | |
QgsAnnotationItemAddedToLayerFunc | mAddedToLayerFunc = nullptr |
QgsAnnotationItemCreateFunc | mCreateFunc = nullptr |
QgsCreateAnnotationItemMapToolFunc | mCreateMapToolFunc = nullptr |
QIcon | mIcon |
QgsAnnotationItemWidgetFunc | mWidgetFunc = nullptr |
Convenience metadata class that uses static functions to handle annotation item GUI behavior.
Definition at line 156 of file qgsannotationitemguiregistry.h.
|
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.
|
overridevirtual |
Creates an instance of the corresponding item type.
Reimplemented from QgsAnnotationItemAbstractGuiMetadata.
Definition at line 70 of file qgsannotationitemguiregistry.cpp.
|
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.
|
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.
|
inline |
Returns the classes' create new item map tool creation function.
Definition at line 198 of file qgsannotationitemguiregistry.h.
|
overridevirtual |
Returns an icon representing creation of the annotation item type.
Reimplemented from QgsAnnotationItemAbstractGuiMetadata.
Definition at line 60 of file qgsannotationitemguiregistry.cpp.
|
inline |
Returns the classes' item added to layer function.
Definition at line 222 of file qgsannotationitemguiregistry.h.
|
inline |
Returns the classes' item creation function.
Definition at line 210 of file qgsannotationitemguiregistry.h.
|
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.
|
inline |
Sets the classes' create new item map tool creation function.
Definition at line 204 of file qgsannotationitemguiregistry.h.
|
inline |
Sets the classes' item creation function.
Definition at line 228 of file qgsannotationitemguiregistry.h.
|
inline |
Sets the classes' item creation function.
Definition at line 216 of file qgsannotationitemguiregistry.h.
|
inline |
Sets the classes' configuration widget creation function.
Definition at line 192 of file qgsannotationitemguiregistry.h.
|
inline |
Returns the classes' configuration widget creation function.
Definition at line 186 of file qgsannotationitemguiregistry.h.
|
protected |
Definition at line 242 of file qgsannotationitemguiregistry.h.
|
protected |
Definition at line 240 of file qgsannotationitemguiregistry.h.
|
protected |
Definition at line 241 of file qgsannotationitemguiregistry.h.
|
protected |
Definition at line 238 of file qgsannotationitemguiregistry.h.
|
protected |
Definition at line 239 of file qgsannotationitemguiregistry.h.