QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
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...
 
typedef QFlags< FlagFlags
 

Public Member Functions

 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
 
virtual QgsLayoutItemcreateItem (QgsLayout *layout)
 Creates an instance of the corresponding item type.
 
virtual QgsLayoutItemBaseWidgetcreateItemWidget (QgsLayoutItem *item)
 Creates a configuration widget for an item of this type.
 
virtual QAbstractGraphicsShapeItem * createNodeRubberBand (QgsLayoutView *view)
 Creates a rubber band for use when creating layout node based items of this type.
 
virtual QgsLayoutViewRubberBandcreateRubberBand (QgsLayoutView *view)
 Creates a rubber band for use when creating layout items of this type.
 
virtual QIcon creationIcon () const
 Returns an icon representing creation of the layout item type.
 
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.
 
virtual void newItemAddedToLayout (QgsLayoutItem *item)
 Called when a newly created item of the associated type has been added to a layout.
 
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.
 

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.

Definition at line 45 of file qgslayoutitemguiregistry.h.

Member Typedef Documentation

◆ Flags

Definition at line 54 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 50 of file qgslayoutitemguiregistry.h.

Constructor & Destructor Documentation

◆ QgsLayoutItemAbstractGuiMetadata()

QgsLayoutItemAbstractGuiMetadata::QgsLayoutItemAbstractGuiMetadata ( int  type,
const QString &  visibleName,
const QString &  groupId = QString(),
bool  isNodeBased = false,
Flags  flags = QgsLayoutItemAbstractGuiMetadata::Flags() 
)
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 65 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 36 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 123 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 31 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 26 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 103 of file qgslayoutitemguiregistry.h.

◆ flags()

Flags QgsLayoutItemAbstractGuiMetadata::flags ( ) const
inline

Returns item flags.

Definition at line 83 of file qgslayoutitemguiregistry.h.

◆ groupId()

QString QgsLayoutItemAbstractGuiMetadata::groupId ( ) const
inline

Returns the item group ID, if set.

Definition at line 88 of file qgslayoutitemguiregistry.h.

◆ isNodeBased()

bool QgsLayoutItemAbstractGuiMetadata::isNodeBased ( ) const
inline

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

Definition at line 93 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 41 of file qgslayoutitemguiregistry.cpp.

◆ type()

int QgsLayoutItemAbstractGuiMetadata::type ( ) const
inline

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

Definition at line 78 of file qgslayoutitemguiregistry.h.

◆ visibleName()

QString QgsLayoutItemAbstractGuiMetadata::visibleName ( ) const
inline

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

Definition at line 98 of file qgslayoutitemguiregistry.h.


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