16#ifndef QGSLAYOUTITEMREGISTRY_H
17#define QGSLAYOUTITEMREGISTRY_H
23#include <QGraphicsItem>
56 , mVisibleName( visibleName )
57 , mVisibleNamePlural( visiblePluralName.isEmpty() ? visibleName : visiblePluralName )
65 int type()
const {
return mType; }
108 Q_UNUSED( properties )
109 Q_UNUSED( pathResolver )
116 QString mVisibleName;
117 QString mVisibleNamePlural;
147 , mCreateFunc( pfCreate )
148 , mPathResolverFunc( pfPathResolver )
165 if ( mPathResolverFunc )
166 mPathResolverFunc( properties, pathResolver, saving );
196 , mVisibleName( visibleName )
204 int type()
const {
return mType; }
245 Q_UNUSED( properties )
246 Q_UNUSED( pathResolver )
253 QString mVisibleName;
281 , mCreateFunc( pfCreate )
282 , mPathResolverFunc( pfPathResolver )
299 if ( mPathResolverFunc )
300 mPathResolverFunc( properties, pathResolver, saving );
333 LayoutItem = QGraphicsItem::UserType + 100,
372 PluginItem = LayoutTextTable + 10000,
456 void resolvePaths(
int type, QVariantMap &properties,
const QgsPathResolver &pathResolver,
bool saving )
const;
461 QMap< int, QString> itemTypes()
const;
482 QMap<int, QgsLayoutItemAbstractMetadata *> mMetadata;
483 QMap<int, QgsLayoutMultiFrameAbstractMetadata *> mMultiFrameMetadata;
504 ~TestLayoutItem() =
default;
508 void draw(
QgsRenderContext &context,
const QStyleOptionGraphicsItem *itemStyle =
nullptr )
override;
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Registry of available layout item types.
void typeAdded(int type, const QString &name)
Emitted whenever a new item type is added to the registry, with the specified type and visible name.
@ LayoutManualTable
Manual (fixed) table.
@ LayoutElevationProfile
Elevation profile item (since QGIS 3.30)
@ LayoutPicture
Picture item.
@ LayoutGroup
Grouped item.
@ LayoutAttributeTable
Attribute table.
@ LayoutPolyline
Polyline shape item.
@ LayoutScaleBar
Scale bar item.
@ LayoutItem
Base class for items.
@ LayoutLegend
Legend item.
@ LayoutMarker
Marker item.
@ LayoutHtml
Html multiframe item.
@ LayoutTextTable
Preset text table.
@ LayoutFrame
Frame item, part of a QgsLayoutMultiFrame object.
@ LayoutPolygon
Polygon shape item.
void multiFrameTypeAdded(int type, const QString &name)
Emitted whenever a new multiframe type is added to the registry, with the specified type and visible ...
QgsLayoutItemRegistry(const QgsLayoutItemRegistry &rh)=delete
QgsLayoutItemRegistry cannot be copied.
QgsLayoutItemRegistry & operator=(const QgsLayoutItemRegistry &rh)=delete
QgsLayoutItemRegistry cannot be copied.
Base class for graphical items within a QgsLayout.
Abstract base class for layout items with the ability to distribute the content to several frames (Qg...
A graphical widget to display and interact with QgsLayouts.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Resolves relative paths into absolute paths and vice versa.
Contains information about the context of a rendering operation.
std::function< QgsLayoutMultiFrame *(QgsLayout *)> QgsLayoutMultiFrameCreateFunc
Layout multiframe creation function.
std::function< QgsLayoutItem *(QgsLayout *)> QgsLayoutItemCreateFunc
Layout item creation function.
std::function< void(QVariantMap &, const QgsPathResolver &, bool)> QgsLayoutMultiFramePathResolverFunc
Layout multiframe path resolver function.
std::function< void(QVariantMap &, const QgsPathResolver &, bool)> QgsLayoutItemPathResolverFunc
Layout item path resolver function.