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,
324 PluginItem = LayoutTextTable + 10000,
393 void resolvePaths(
int type, QVariantMap &properties,
const QgsPathResolver &pathResolver,
bool saving )
const;
398 QMap< int, QString> itemTypes()
const;
406 void typeAdded(
int type,
const QString &name );
412 void multiFrameTypeAdded(
int type,
const QString &name );
419 QMap<int, QgsLayoutItemAbstractMetadata *> mMetadata;
420 QMap<int, QgsLayoutMultiFrameAbstractMetadata *> mMultiFrameMetadata;
441 ~TestLayoutItem() =
default;
445 void draw(
QgsRenderContext &context,
const QStyleOptionGraphicsItem *itemStyle =
nullptr )
override;
455 #endif //QGSLAYOUTITEMREGISTRY_H
Base class for graphical items within a QgsLayout.
int type() const override
Returns a unique graphics item type identifier.
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.
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.