16 #ifndef QGSLAYOUTITEMREGISTRY_H 17 #define QGSLAYOUTITEMREGISTRY_H 19 #include "qgis_core.h" 23 #include <QGraphicsItem> 57 , mVisibleName( visibleName )
58 , mVisibleNamePlural( visiblePluralName.isEmpty() ? visibleName : visiblePluralName )
66 int type()
const {
return mType; }
94 Q_UNUSED( properties )
95 Q_UNUSED( pathResolver )
102 QString mVisibleName;
103 QString mVisibleNamePlural;
134 , mCreateFunc( pfCreate )
135 , mPathResolverFunc( pfPathResolver )
152 if ( mPathResolverFunc )
153 mPathResolverFunc( properties, pathResolver, saving );
184 , mVisibleName( visibleName )
192 int type()
const {
return mType; }
218 Q_UNUSED( properties )
219 Q_UNUSED( pathResolver )
226 QString mVisibleName;
255 , mCreateFunc( pfCreate )
256 , mPathResolverFunc( pfPathResolver )
273 if ( mPathResolverFunc )
274 mPathResolverFunc( properties, pathResolver, saving );
308 LayoutItem = QGraphicsItem::UserType + 100,
339 PluginItem = LayoutTextTable + 10000,
408 void resolvePaths(
int type, QVariantMap &properties,
const QgsPathResolver &pathResolver,
bool saving )
const;
413 QMap< int, QString> itemTypes()
const;
421 void typeAdded(
int type,
const QString &name );
427 void multiFrameTypeAdded(
int type,
const QString &name );
434 QMap<int, QgsLayoutItemAbstractMetadata *> mMetadata;
435 QMap<int, QgsLayoutMultiFrameAbstractMetadata *> mMultiFrameMetadata;
456 ~TestLayoutItem() =
default;
460 void draw(
QgsRenderContext &context,
const QStyleOptionGraphicsItem *itemStyle =
nullptr )
override;
470 #endif //QGSLAYOUTITEMREGISTRY_H
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.
static QIcon getThemeIcon(const QString &name)
Helper to get a theme icon.
Abstract base class for layout items with the ability to distribute the content to several frames (Qg...
std::function< QgsLayoutMultiFrame *(QgsLayout *)> QgsLayoutMultiFrameCreateFunc
Layout multiframe creation function.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Frame item, part of a QgsLayoutMultiFrame object.
Contains information about the context of a rendering operation.
Registry of available layout item types.
virtual void draw(QgsLayoutItemRenderContext &context)=0
Draws the item's contents using the specified item render context.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
std::function< void(QVariantMap &, const QgsPathResolver &, bool)> QgsLayoutMultiFramePathResolverFunc
Layout multiframe path resolver function.
Resolves relative paths into absolute paths and vice versa.
std::function< QgsLayoutItem *(QgsLayout *)> QgsLayoutItemCreateFunc
Layout item creation function.
std::function< void(QVariantMap &, const QgsPathResolver &, bool)> QgsLayoutItemPathResolverFunc
Layout item path resolver function.