QGIS API Documentation  3.8.0-Zanzibar (11aff65)
Signals | Public Member Functions | List of all members
QgsLayoutItemGuiRegistry Class Reference

Registry of available layout item GUI behavior. More...

#include <qgslayoutitemguiregistry.h>

Inheritance diagram for QgsLayoutItemGuiRegistry:
Inheritance graph
[legend]

Signals

void typeAdded (int metadataId)
 Emitted whenever a new item type is added to the registry, with the specified metadataId. More...
 

Public Member Functions

 QgsLayoutItemGuiRegistry (QObject *parent=nullptr)
 Creates a new empty item GUI registry. More...
 
 QgsLayoutItemGuiRegistry (const QgsLayoutItemGuiRegistry &rh)=delete
 QgsLayoutItemGuiRegistry cannot be copied. More...
 
 ~QgsLayoutItemGuiRegistry () override
 
bool addItemGroup (const QgsLayoutItemGuiGroup &group)
 Registers a new item group with the registry. More...
 
bool addLayoutItemGuiMetadata (QgsLayoutItemAbstractGuiMetadata *metadata)
 Registers the gui metadata for a new layout item type. More...
 
QgsLayoutItemcreateItem (int metadataId, QgsLayout *layout) const
 Creates a new instance of a layout item given the item metadata metadataId, target layout. More...
 
QgsLayoutViewRubberBandcreateItemRubberBand (int metadataId, QgsLayoutView *view) const
 Creates a new rubber band item for the specified item metadataId and destination view. More...
 
QgsLayoutItemBaseWidgetcreateItemWidget (QgsLayoutItem *item) const
 Creates a new instance of a layout item configuration widget for the specified item. More...
 
QAbstractGraphicsShapeItem * createNodeItemRubberBand (int metadataId, QgsLayoutView *view)
 Creates a rubber band for the specified item metadataId and destination view. More...
 
const QgsLayoutItemGuiGroupitemGroup (const QString &id)
 Returns a reference to the item group with matching id. More...
 
QgsLayoutItemAbstractGuiMetadataitemMetadata (int metadataId) const
 Returns the metadata for the specified item metadataId. More...
 
QList< int > itemMetadataIds () const
 Returns a list of available item metadata ids handled by the registry. More...
 
void newItemAddedToLayout (int metadataId, QgsLayoutItem *item)
 Called when a newly created item of the associated metadata metadataId has been added to a layout. More...
 
QgsLayoutItemGuiRegistryoperator= (const QgsLayoutItemGuiRegistry &rh)=delete
 QgsLayoutItemGuiRegistry cannot be copied. More...
 

Detailed Description

Registry of available layout item GUI behavior.

QgsLayoutItemGuiRegistry is not usually directly created, but rather accessed through QgsGui::layoutItemGuiRegistry().

This acts as a companion to QgsLayoutItemRegistry, handling only the components related to the GUI behavior of layout items.

Since
QGIS 3.0

Definition at line 331 of file qgslayoutitemguiregistry.h.

Constructor & Destructor Documentation

◆ QgsLayoutItemGuiRegistry() [1/2]

QgsLayoutItemGuiRegistry::QgsLayoutItemGuiRegistry ( QObject *  parent = nullptr)

Creates a new empty item GUI registry.

QgsLayoutItemGuiRegistry is not usually directly created, but rather accessed through QgsGui::layoutItemGuiRegistry().

Definition at line 45 of file qgslayoutitemguiregistry.cpp.

◆ ~QgsLayoutItemGuiRegistry()

QgsLayoutItemGuiRegistry::~QgsLayoutItemGuiRegistry ( )
override

Definition at line 50 of file qgslayoutitemguiregistry.cpp.

◆ QgsLayoutItemGuiRegistry() [2/2]

QgsLayoutItemGuiRegistry::QgsLayoutItemGuiRegistry ( const QgsLayoutItemGuiRegistry rh)
delete

QgsLayoutItemGuiRegistry cannot be copied.

Member Function Documentation

◆ addItemGroup()

bool QgsLayoutItemGuiRegistry::addItemGroup ( const QgsLayoutItemGuiGroup group)

Registers a new item group with the registry.

This must be done before calling addLayoutItemGuiMetadata() for any item types associated with the group.

Returns true if group was added, or false if group could not be added (e.g. due to duplicate id value).

See also
itemGroup()

Definition at line 71 of file qgslayoutitemguiregistry.cpp.

◆ addLayoutItemGuiMetadata()

bool QgsLayoutItemGuiRegistry::addLayoutItemGuiMetadata ( QgsLayoutItemAbstractGuiMetadata metadata)

Registers the gui metadata for a new layout item type.

Takes ownership of the metadata instance.

Definition at line 60 of file qgslayoutitemguiregistry.cpp.

◆ createItem()

QgsLayoutItem * QgsLayoutItemGuiRegistry::createItem ( int  metadataId,
QgsLayout layout 
) const

Creates a new instance of a layout item given the item metadata metadataId, target layout.

Definition at line 85 of file qgslayoutitemguiregistry.cpp.

◆ createItemRubberBand()

QgsLayoutViewRubberBand * QgsLayoutItemGuiRegistry::createItemRubberBand ( int  metadataId,
QgsLayoutView view 
) const

Creates a new rubber band item for the specified item metadataId and destination view.

Note
not available from Python bindings
See also
createNodeItemRubberBand()

Definition at line 127 of file qgslayoutitemguiregistry.cpp.

◆ createItemWidget()

QgsLayoutItemBaseWidget * QgsLayoutItemGuiRegistry::createItemWidget ( QgsLayoutItem item) const

Creates a new instance of a layout item configuration widget for the specified item.

Definition at line 106 of file qgslayoutitemguiregistry.cpp.

◆ createNodeItemRubberBand()

QAbstractGraphicsShapeItem * QgsLayoutItemGuiRegistry::createNodeItemRubberBand ( int  metadataId,
QgsLayoutView view 
)

Creates a rubber band for the specified item metadataId and destination view.

Can return nullptr if no node based rubber band should be created or is applicable for the item.

See also
createItemRubberBand()
Note
not available from Python bindings

Definition at line 135 of file qgslayoutitemguiregistry.cpp.

◆ itemGroup()

const QgsLayoutItemGuiGroup & QgsLayoutItemGuiRegistry::itemGroup ( const QString &  id)

Returns a reference to the item group with matching id.

See also
addItemGroup()

Definition at line 80 of file qgslayoutitemguiregistry.cpp.

◆ itemMetadata()

QgsLayoutItemAbstractGuiMetadata * QgsLayoutItemGuiRegistry::itemMetadata ( int  metadataId) const

Returns the metadata for the specified item metadataId.

Returns nullptr if a corresponding metadataId was not found in the registry.

Definition at line 55 of file qgslayoutitemguiregistry.cpp.

◆ itemMetadataIds()

QList< int > QgsLayoutItemGuiRegistry::itemMetadataIds ( ) const

Returns a list of available item metadata ids handled by the registry.

Definition at line 143 of file qgslayoutitemguiregistry.cpp.

◆ newItemAddedToLayout()

void QgsLayoutItemGuiRegistry::newItemAddedToLayout ( int  metadataId,
QgsLayoutItem item 
)

Called when a newly created item of the associated metadata metadataId 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.

Definition at line 98 of file qgslayoutitemguiregistry.cpp.

◆ operator=()

QgsLayoutItemGuiRegistry& QgsLayoutItemGuiRegistry::operator= ( const QgsLayoutItemGuiRegistry rh)
delete

QgsLayoutItemGuiRegistry cannot be copied.

◆ typeAdded

void QgsLayoutItemGuiRegistry::typeAdded ( int  metadataId)
signal

Emitted whenever a new item type is added to the registry, with the specified metadataId.


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