QGIS API Documentation  3.6.0-Noosa (5873452)
Public Types | Public Member Functions | List of all members
QgsLayoutItemAbstractGuiMetadata Class Reference

Stores GUI metadata about one layout item class. More...

#include <qgslayoutitemguiregistry.h>

Inheritance diagram for QgsLayoutItemAbstractGuiMetadata:
Inheritance graph
[legend]

Public Types

enum  Flag { FlagNoCreationTools = 1 << 1 }
 Flags for controlling how a items behave in the GUI. More...
 

Public Member Functions

 QgsLayoutItemAbstractGuiMetadata (int type, const QString &visibleName, const QString &groupId=QString(), bool isNodeBased=false, Flags flags=nullptr)
 Constructor for QgsLayoutItemAbstractGuiMetadata with the specified class type. More...
 
virtual ~QgsLayoutItemAbstractGuiMetadata ()=default
 
virtual QgsLayoutItemcreateItem (QgsLayout *layout)
 Creates an instance of the corresponding item type. More...
 
virtual QgsLayoutItemBaseWidgetcreateItemWidget (QgsLayoutItem *item)
 Creates a configuration widget for an item of this type. More...
 
virtual QAbstractGraphicsShapeItem * createNodeRubberBand (QgsLayoutView *view)
 Creates a rubber band for use when creating layout node based items of this type. More...
 
virtual QgsLayoutViewRubberBandcreateRubberBand (QgsLayoutView *view)
 Creates a rubber band for use when creating layout items of this type. More...
 
virtual QIcon creationIcon () const
 Returns an icon representing creation of the layout item type. More...
 
Flags flags () const
 Returns item flags. More...
 
QString groupId () const
 Returns the item group ID, if set. More...
 
bool isNodeBased () const
 Returns true if the associated item is a node based item. More...
 
virtual void newItemAddedToLayout (QgsLayoutItem *item)
 Called when a newly created item of the associated type has been added to a layout. More...
 
int type () const
 Returns the unique item type code for the layout item class. More...
 
QString visibleName () const
 Returns a translated, user visible name identifying the corresponding layout item. More...
 

Detailed Description

Stores GUI metadata about one layout item class.

This is a companion to QgsLayoutItemAbstractMetadata, storing only the components related to the GUI behavior of a layout item.

Note
In C++ you can use QgsLayoutItemGuiMetadata convenience class.
Since
QGIS 3.0

Definition at line 46 of file qgslayoutitemguiregistry.h.

Member Enumeration Documentation

◆ Flag

Flags for controlling how a items behave in the GUI.

Enumerator
FlagNoCreationTools 

Do not show item creation tools for the item type.

Definition at line 51 of file qgslayoutitemguiregistry.h.

Constructor & Destructor Documentation

◆ QgsLayoutItemAbstractGuiMetadata()

QgsLayoutItemAbstractGuiMetadata::QgsLayoutItemAbstractGuiMetadata ( int  type,
const QString &  visibleName,
const QString &  groupId = QString(),
bool  isNodeBased = false,
Flags  flags = nullptr 
)
inline

Constructor for QgsLayoutItemAbstractGuiMetadata with the specified class type.

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 66 of file qgslayoutitemguiregistry.h.

◆ ~QgsLayoutItemAbstractGuiMetadata()

virtual QgsLayoutItemAbstractGuiMetadata::~QgsLayoutItemAbstractGuiMetadata ( )
virtualdefault

Member Function Documentation

◆ createItem()

QgsLayoutItem * QgsLayoutItemAbstractGuiMetadata::createItem ( QgsLayout layout)
virtual

Creates an instance of the corresponding item type.

Reimplemented in QgsLayoutItemGuiMetadata.

Definition at line 35 of file qgslayoutitemguiregistry.cpp.

◆ createItemWidget()

virtual QgsLayoutItemBaseWidget* QgsLayoutItemAbstractGuiMetadata::createItemWidget ( QgsLayoutItem item)
inlinevirtual

Creates a configuration widget for an item of this type.

Can return nullptr if no configuration GUI is required.

Reimplemented in QgsLayoutItemGuiMetadata.

Definition at line 109 of file qgslayoutitemguiregistry.h.

◆ createNodeRubberBand()

QAbstractGraphicsShapeItem * QgsLayoutItemAbstractGuiMetadata::createNodeRubberBand ( QgsLayoutView view)
virtual

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.

See also
createRubberBand()

Reimplemented in QgsLayoutItemGuiMetadata.

Definition at line 30 of file qgslayoutitemguiregistry.cpp.

◆ createRubberBand()

QgsLayoutViewRubberBand * QgsLayoutItemAbstractGuiMetadata::createRubberBand ( QgsLayoutView view)
virtual

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.

See also
createNodeRubberBand()

Reimplemented in QgsLayoutItemGuiMetadata.

Definition at line 25 of file qgslayoutitemguiregistry.cpp.

◆ creationIcon()

virtual QIcon QgsLayoutItemAbstractGuiMetadata::creationIcon ( ) const
inlinevirtual

Returns an icon representing creation of the layout item type.

Reimplemented in QgsLayoutItemGuiMetadata.

Definition at line 104 of file qgslayoutitemguiregistry.h.

◆ flags()

Flags QgsLayoutItemAbstractGuiMetadata::flags ( ) const
inline

Returns item flags.

Definition at line 84 of file qgslayoutitemguiregistry.h.

◆ groupId()

QString QgsLayoutItemAbstractGuiMetadata::groupId ( ) const
inline

Returns the item group ID, if set.

Definition at line 89 of file qgslayoutitemguiregistry.h.

◆ isNodeBased()

bool QgsLayoutItemAbstractGuiMetadata::isNodeBased ( ) const
inline

Returns true if the associated item is a node based item.

Definition at line 94 of file qgslayoutitemguiregistry.h.

◆ newItemAddedToLayout()

void QgsLayoutItemAbstractGuiMetadata::newItemAddedToLayout ( QgsLayoutItem item)
virtual

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 in QgsLayoutItemGuiMetadata.

Definition at line 40 of file qgslayoutitemguiregistry.cpp.

◆ type()

int QgsLayoutItemAbstractGuiMetadata::type ( ) const
inline

Returns the unique item type code for the layout item class.

Definition at line 79 of file qgslayoutitemguiregistry.h.

◆ visibleName()

QString QgsLayoutItemAbstractGuiMetadata::visibleName ( ) const
inline

Returns a translated, user visible name identifying the corresponding layout item.

Definition at line 99 of file qgslayoutitemguiregistry.h.


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