16 #ifndef QGSLAYOUTITEMREGISTRY_H 17 #define QGSLAYOUTITEMREGISTRY_H 19 #include "qgis_core.h" 23 #include <QGraphicsItem> 55 , mVisibleName( visibleName )
63 int type()
const {
return mType; }
84 Q_UNUSED( properties )
85 Q_UNUSED( pathResolver )
121 , mCreateFunc( pfCreate )
122 , mPathResolverFunc( pfPathResolver )
139 if ( mPathResolverFunc )
140 mPathResolverFunc( properties, pathResolver, saving );
171 , mVisibleName( visibleName )
179 int type()
const {
return mType; }
205 Q_UNUSED( properties )
206 Q_UNUSED( pathResolver )
213 QString mVisibleName;
242 , mCreateFunc( pfCreate )
243 , mPathResolverFunc( pfPathResolver )
260 if ( mPathResolverFunc )
261 mPathResolverFunc( properties, pathResolver, saving );
295 LayoutItem = QGraphicsItem::UserType + 100,
326 PluginItem = LayoutTextTable + 10000,
395 void resolvePaths(
int type, QVariantMap &properties,
const QgsPathResolver &pathResolver,
bool saving )
const;
400 QMap< int, QString> itemTypes()
const;
408 void typeAdded(
int type,
const QString &name );
414 void multiFrameTypeAdded(
int type,
const QString &name );
421 QMap<int, QgsLayoutItemAbstractMetadata *> mMetadata;
422 QMap<int, QgsLayoutMultiFrameAbstractMetadata *> mMultiFrameMetadata;
443 ~TestLayoutItem() =
default;
447 void draw(
QgsRenderContext &context,
const QStyleOptionGraphicsItem *itemStyle =
nullptr )
override;
457 #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.