16#ifndef QGSLAYOUTITEMREGISTRY_H
17#define QGSLAYOUTITEMREGISTRY_H
23#include <QGraphicsItem>
57 , mVisibleName( visibleName )
58 , mVisibleNamePlural( visiblePluralName.isEmpty() ? visibleName : visiblePluralName )
66 int type()
const {
return mType; }
109 Q_UNUSED( properties )
110 Q_UNUSED( pathResolver )
117 QString mVisibleName;
118 QString mVisibleNamePlural;
149 , mCreateFunc( pfCreate )
150 , mPathResolverFunc( pfPathResolver )
167 if ( mPathResolverFunc )
168 mPathResolverFunc( properties, pathResolver, saving );
199 , mVisibleName( visibleName )
207 int type()
const {
return mType; }
248 Q_UNUSED( properties )
249 Q_UNUSED( pathResolver )
256 QString mVisibleName;
285 , mCreateFunc( pfCreate )
286 , mPathResolverFunc( pfPathResolver )
303 if ( mPathResolverFunc )
304 mPathResolverFunc( properties, pathResolver, saving );
338 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.
@ 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.