|
QGIS API Documentation 4.1.0-Master (5bf3c20f3c9)
|
Convenience metadata class that uses static functions to handle layout item GUI behavior. More...
#include <qgslayoutitemguiregistry.h>

Public Member Functions | |
| QgsLayoutItemGuiMetadata (int type, const QString &visibleName, const QIcon &creationIcon, const QgsLayoutItemWidgetFunc &pfWidget=nullptr, const QgsLayoutItemRubberBandFunc &pfRubberBand=nullptr, const QString &groupId=QString(), bool isNodeBased=false, QgsLayoutItemAbstractGuiMetadata::Flags flags=QgsLayoutItemAbstractGuiMetadata::Flags(), const QgsLayoutItemCreateFunc &pfCreateFunc=nullptr) | |
| Constructor for QgsLayoutItemGuiMetadata with the specified class type and creationIcon, and function pointers for the various configuration widget creation functions. | |
| QgsLayoutItem * | createItem (QgsLayout *layout) override |
| Creates an instance of the corresponding item type. | |
| QgsLayoutItemBaseWidget * | createItemWidget (QgsLayoutItem *item) override |
| Creates a configuration widget for an item of this type. | |
| QGraphicsItem * | createNodeRubberBand (QgsLayoutView *view) override |
| Creates a rubber band for use when creating layout node based items of this type. | |
| QgsLayoutViewRubberBand * | createRubberBand (QgsLayoutView *view) override |
| Creates a rubber band for use when creating layout items of this type. | |
| QIcon | creationIcon () const override |
| Returns an icon representing creation of the layout item type. | |
| void | handleDoubleClick (QgsLayoutItem *item, Qgis::MouseHandlesAction action) override |
| Called when a layout item is double-clicked. | |
| QgsLayoutItemAddedToLayoutFunc | itemAddToLayoutFunction () const |
| Returns the classes' item added to layout function. | |
| QgsLayoutItemCreateFunc | itemCreationFunction () const |
| Returns the classes' item creation function. | |
| QgsLayoutItemDoubleClickedFunc | itemDoubleClickedFunction () const |
| Returns the classes' item double clicked function. | |
| void | newItemAddedToLayout (QgsLayoutItem *item) override |
| Called when a newly created item of the associated type has been added to a layout. | |
| void | newItemAddedToLayout (QgsLayoutItem *item, const QVariantMap &properties) |
| Called when a newly created item of the associated type has been added to a layout. | |
| QgsLayoutNodeItemRubberBandFunc | nodeRubberBandCreationFunction () const |
| Returns the classes' node based rubber band creation function. | |
| QgsLayoutItemRubberBandFunc | rubberBandCreationFunction () const |
| Returns the classes' rubber band creation function. | |
| void | setItemAddedToLayoutFunction (const QgsLayoutItemAddedToLayoutFunc &function) |
| Sets the classes' item creation function. | |
| void | setItemCreationFunction (const QgsLayoutItemCreateFunc &function) |
| Sets the classes' item creation function. | |
| void | setItemDoubleClickedFunction (const QgsLayoutItemDoubleClickedFunc &function) |
| Sets the classes' item double clicked function. | |
| void | setNodeRubberBandCreationFunction (const QgsLayoutNodeItemRubberBandFunc &function) |
| Sets the classes' node based rubber band creation function. | |
| void | setRubberBandCreationFunction (const QgsLayoutItemRubberBandFunc &function) |
| Sets the classes' rubber band creation function. | |
| void | setWidgetFunction (const QgsLayoutItemWidgetFunc &function) |
| Sets the classes' configuration widget creation function. | |
| QgsLayoutItemWidgetFunc | widgetFunction () const |
| Returns the classes' configuration widget creation function. | |
| Public Member Functions inherited from QgsLayoutItemAbstractGuiMetadata | |
| QgsLayoutItemAbstractGuiMetadata (int type, const QString &visibleName, const QString &groupId=QString(), bool isNodeBased=false, Flags flags=QgsLayoutItemAbstractGuiMetadata::Flags()) | |
| Constructor for QgsLayoutItemAbstractGuiMetadata with the specified class type. | |
| virtual | ~QgsLayoutItemAbstractGuiMetadata ()=default |
| Flags | flags () const |
| Returns item flags. | |
| QString | groupId () const |
| Returns the item group ID, if set. | |
| bool | isNodeBased () const |
Returns true if the associated item is a node based item. | |
| int | type () const |
| Returns the unique item type code for the layout item class. | |
| QString | visibleName () const |
| Returns a translated, user visible name identifying the corresponding layout item. | |
Protected Attributes | |
| QgsLayoutItemAddedToLayoutFunc | mAddedToLayoutFunc = nullptr |
| QgsLayoutItemCreateFunc | mCreateFunc = nullptr |
| QgsLayoutItemDoubleClickedFunc | mDoubleClickedFunc = nullptr |
| QIcon | mIcon |
| QgsLayoutNodeItemRubberBandFunc | mNodeRubberBandFunc = nullptr |
| QgsLayoutItemRubberBandFunc | mRubberBandFunc = nullptr |
| QgsLayoutItemWidgetFunc | mWidgetFunc = nullptr |
Additional Inherited Members | |
| Public Types inherited from QgsLayoutItemAbstractGuiMetadata | |
| enum | Flag { FlagNoCreationTools = 1 << 1 } |
| Flags for controlling how a items behave in the GUI. More... | |
| typedef QFlags< Flag > | Flags |
Convenience metadata class that uses static functions to handle layout item GUI behavior.
Definition at line 198 of file qgslayoutitemguiregistry.h.
|
inline |
Constructor for QgsLayoutItemGuiMetadata 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 layout item.
An optional groupId can be set, which allows grouping of related layout item classes. See QgsLayoutItemGuiMetadata for details.
If isNodeBased is true, then the corresponding item is a node based item.
Definition at line 212 of file qgslayoutitemguiregistry.h.
|
overridevirtual |
Creates an instance of the corresponding item type.
Reimplemented from QgsLayoutItemAbstractGuiMetadata.
Definition at line 208 of file qgslayoutitemguiregistry.cpp.
|
inlineoverridevirtual |
Creates a configuration widget for an item of this type.
Can return nullptr if no configuration GUI is required.
Reimplemented from QgsLayoutItemAbstractGuiMetadata.
Definition at line 305 of file qgslayoutitemguiregistry.h.
|
inlineoverridevirtual |
Creates a rubber band for use when creating layout node based items of this type.
Can return nullptr if no rubber band should be created. The default behavior is to return nullptr.
Reimplemented from QgsLayoutItemAbstractGuiMetadata.
Definition at line 307 of file qgslayoutitemguiregistry.h.
|
inlineoverridevirtual |
Creates a rubber band for use when creating layout items of this type.
Can return nullptr if no rubber band should be created. The default behavior is to create a rectangular rubber band.
Reimplemented from QgsLayoutItemAbstractGuiMetadata.
Definition at line 306 of file qgslayoutitemguiregistry.h.
|
inlineoverridevirtual |
Returns an icon representing creation of the layout item type.
Reimplemented from QgsLayoutItemAbstractGuiMetadata.
Definition at line 304 of file qgslayoutitemguiregistry.h.
|
overridevirtual |
Called when a layout item is double-clicked.
The action parameter is used to specify which mouse handle, if any, was clicked If no mouse handle is selected, Qgis::MouseHandlesAction::NoAction is used
Reimplemented from QgsLayoutItemAbstractGuiMetadata.
Definition at line 49 of file qgslayoutitemguiregistry.cpp.
|
inline |
Returns the classes' item added to layout function.
Definition at line 282 of file qgslayoutitemguiregistry.h.
|
inline |
Returns the classes' item creation function.
Definition at line 270 of file qgslayoutitemguiregistry.h.
|
inline |
Returns the classes' item double clicked function.
Definition at line 294 of file qgslayoutitemguiregistry.h.
|
overridevirtual |
Called when a newly created item of the associated type has been added to a layout.
This is only called for additions which result from GUI operations - i.e. it is not called for items added from templates.
Reimplemented from QgsLayoutItemAbstractGuiMetadata.
Definition at line 213 of file qgslayoutitemguiregistry.cpp.
| void QgsLayoutItemGuiMetadata::newItemAddedToLayout | ( | QgsLayoutItem * | item, |
| const QVariantMap & | properties ) |
Called when a newly created item of the associated type has been added to a layout.
This is only called for additions which result from GUI operations - i.e. it is not called for items added from templates.
The properties map will be filled with any custom properties which were specified during the item creation.
Definition at line 219 of file qgslayoutitemguiregistry.cpp.
|
inline |
Returns the classes' node based rubber band creation function.
Definition at line 258 of file qgslayoutitemguiregistry.h.
|
inline |
Returns the classes' rubber band creation function.
Definition at line 246 of file qgslayoutitemguiregistry.h.
|
inline |
Sets the classes' item creation function.
Definition at line 288 of file qgslayoutitemguiregistry.h.
|
inline |
Sets the classes' item creation function.
Definition at line 276 of file qgslayoutitemguiregistry.h.
|
inline |
Sets the classes' item double clicked function.
Definition at line 300 of file qgslayoutitemguiregistry.h.
|
inline |
Sets the classes' node based rubber band creation function.
Definition at line 264 of file qgslayoutitemguiregistry.h.
|
inline |
Sets the classes' rubber band creation function.
Definition at line 252 of file qgslayoutitemguiregistry.h.
|
inline |
Sets the classes' configuration widget creation function.
Definition at line 240 of file qgslayoutitemguiregistry.h.
|
inline |
Returns the classes' configuration widget creation function.
Definition at line 234 of file qgslayoutitemguiregistry.h.
|
protected |
Definition at line 331 of file qgslayoutitemguiregistry.h.
|
protected |
Definition at line 330 of file qgslayoutitemguiregistry.h.
|
protected |
Definition at line 332 of file qgslayoutitemguiregistry.h.
|
protected |
Definition at line 326 of file qgslayoutitemguiregistry.h.
|
protected |
Definition at line 329 of file qgslayoutitemguiregistry.h.
|
protected |
Definition at line 328 of file qgslayoutitemguiregistry.h.
|
protected |
Definition at line 327 of file qgslayoutitemguiregistry.h.