52   qDeleteAll( mMetadata );
    57   return mMetadata.value( metadataId );
    65   int id = mMetadata.count();
    66   mMetadata[id] = metadata;
    73   if ( mItemGroups.contains( group.
id ) )
    76   mItemGroups.insert( group.
id, group );
    82   return mItemGroups[ id ];
    87   if ( !mMetadata.contains( metadataId ) )
    90   std::unique_ptr< QgsLayoutItem > item( mMetadata.value( metadataId )->createItem( layout ) );
    92     return item.release();
    94   int type = mMetadata.value( metadataId )->type();
   100   if ( !mMetadata.contains( metadataId ) )
   103   mMetadata.value( metadataId )->newItemAddedToLayout( item );
   111   int type = item->
type();
   116       type = multiFrame->
type();
   118   for ( 
auto it = mMetadata.constBegin(); it != mMetadata.constEnd(); ++it )
   120     if ( it.value()->type() == type )
   121       return it.value()->createItemWidget( item );
   129   if ( !mMetadata.contains( metadataId ) )
   132   return mMetadata[metadataId]->createRubberBand( view );
   137   if ( !mMetadata.contains( metadataId ) )
   140   return mMetadata[metadataId]->createNodeRubberBand( view );
   145   return mMetadata.keys();
   155   if ( mAddedToLayoutFunc )
   156     mAddedToLayoutFunc( item );
 
QgsLayoutItemGuiRegistry(QObject *parent=nullptr)
Creates a new empty item GUI registry. 
 
Stores GUI metadata about a group of layout item classes. 
 
QgsLayoutItem * createItem(int metadataId, QgsLayout *layout) const
Creates a new instance of a layout item given the item metadata metadataId, target layout...
 
QgsLayoutItem * createItem(int type, QgsLayout *layout) const
Creates a new instance of a layout item given the item type, and target layout. 
 
Base class for graphical items within a QgsLayout. 
 
int type() const override
Returns a unique graphics item type identifier. 
 
A graphical widget to display and interact with QgsLayouts. 
 
Abstract base class for layout items with the ability to distribute the content to several frames (Qg...
 
static QgsLayoutItemRegistry * layoutItemRegistry()
Returns the application's layout item registry, used for layout item types. 
 
QString id
Unique (untranslated) group ID string. 
 
Base class for layouts, which can contain items such as maps, labels, scalebars, etc. 
 
bool addItemGroup(const QgsLayoutItemGuiGroup &group)
Registers a new item group with the registry. 
 
Frame item, part of a QgsLayoutMultiFrame object. 
 
~QgsLayoutItemGuiRegistry() override
 
QgsLayoutViewRubberBand * createItemRubberBand(int metadataId, QgsLayoutView *view) const
Creates a new rubber band item for the specified item metadataId and destination view. 
 
QgsLayoutViewRectangularRubberBand is rectangular rubber band for use within QgsLayoutView widgets...
 
QgsLayoutItemBaseWidget * createItemWidget(QgsLayoutItem *item) const
Creates a new instance of a layout item configuration widget for the specified item. 
 
QgsLayoutViewRubberBand is an abstract base class for temporary rubber band items in various shapes...
 
virtual int type() const =0
Returns unique multiframe type id. 
 
QList< int > itemMetadataIds() const
Returns a list of available item metadata ids handled by the registry. 
 
QgsLayoutItemAbstractGuiMetadata * itemMetadata(int metadataId) const
Returns the metadata for the specified item metadataId. 
 
void newItemAddedToLayout(int metadataId, QgsLayoutItem *item)
Called when a newly created item of the associated metadata metadataId has been added to a layout...
 
bool addLayoutItemGuiMetadata(QgsLayoutItemAbstractGuiMetadata *metadata)
Registers the gui metadata for a new layout item type. 
 
const QgsLayoutItemGuiGroup & itemGroup(const QString &id)
Returns a reference to the item group with matching id. 
 
QAbstractGraphicsShapeItem * createNodeItemRubberBand(int metadataId, QgsLayoutView *view)
Creates a rubber band for the specified item metadataId and destination view. 
 
Base class for frame items, which form a layout multiframe item. 
 
void typeAdded(int metadataId)
Emitted whenever a new item type is added to the registry, with the specified metadataId.