16 #ifndef QGSLAYOUTITEMGUIREGISTRY_H
17 #define QGSLAYOUTITEMGUIREGISTRY_H
24 #include <QGraphicsItem>
53 FlagNoCreationTools = 1 << 1,
55 Q_DECLARE_FLAGS( Flags, Flag )
69 , mIsNodeBased( isNodeBased )
70 , mName( visibleName )
79 int type()
const {
return mType; }
84 Flags
flags()
const {
return mFlags; }
89 QString
groupId()
const {
return mGroupId; }
157 bool mIsNodeBased =
false;
201 bool isNodeBased =
false,
202 QgsLayoutItemAbstractGuiMetadata::Flags flags = QgsLayoutItemAbstractGuiMetadata::Flags(),
205 , mIcon( creationIcon )
206 , mWidgetFunc( pfWidget )
207 , mRubberBandFunc( pfRubberBand )
208 , mCreateFunc( pfCreateFunc )
290 void newItemAddedToLayout(
QgsLayoutItem *item,
const QVariantMap &properties );
323 QgsLayoutItemGuiGroup(
const QString &
id = QString(),
const QString &name = QString(),
const QIcon &icon = QIcon() )
397 int metadataIdForItemType(
int type )
const;
450 void newItemAddedToLayout(
int metadataId,
QgsLayoutItem *item,
const QVariantMap &properties = QVariantMap() );
485 QAbstractGraphicsShapeItem *createNodeItemRubberBand(
int metadataId,
QgsLayoutView *view )
SIP_SKIP;
490 QList< int > itemMetadataIds()
const;
505 QMap< int, QgsLayoutItemAbstractGuiMetadata *> mMetadata;
507 QMap< QString, QgsLayoutItemGuiGroup > mItemGroups;
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
Stores GUI metadata about a group of layout item classes.
QString id
Unique (untranslated) group ID string.
QIcon icon
Icon for group.
QgsLayoutItemGuiGroup(const QString &id=QString(), const QString &name=QString(), const QIcon &icon=QIcon())
Constructor for QgsLayoutItemGuiGroup.
QString name
Translated group name.
Registry of available layout item GUI behavior.
QgsLayoutItemGuiRegistry & operator=(const QgsLayoutItemGuiRegistry &rh)=delete
QgsLayoutItemGuiRegistry cannot be copied.
QgsLayoutItemGuiRegistry(const QgsLayoutItemGuiRegistry &rh)=delete
QgsLayoutItemGuiRegistry cannot be copied.
void typeAdded(int metadataId)
Emitted whenever a new item type is added to the registry, with the specified metadataId.
Base class for graphical items within a QgsLayout.
QgsLayoutViewRubberBand is an abstract base class for temporary rubber band items in various shapes,...
A graphical widget to display and interact with QgsLayouts.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
std::function< void(QgsLayoutItem *, const QVariantMap &)> QgsLayoutItemAddedToLayoutFunc
Layout item added to layout callback.
std::function< QgsLayoutViewRubberBand *(QgsLayoutView *)> QgsLayoutItemRubberBandFunc
Layout rubber band creation function.
std::function< QAbstractGraphicsShapeItem *(QgsLayoutView *)> QgsLayoutNodeItemRubberBandFunc
Layout node based rubber band creation function.
std::function< QgsLayoutItemBaseWidget *(QgsLayoutItem *)> QgsLayoutItemWidgetFunc
Layout item configuration widget creation function.
std::function< QgsLayoutItem *(QgsLayout *)> QgsLayoutItemCreateFunc
Layout item creation function.