QGIS API Documentation
3.0.2-Girona (307d082)
|
Registry of available layout item types. More...
#include <qgslayoutitemregistry.h>
Public Types | |
enum | ItemType { LayoutItem = QGraphicsItem::UserType + 100, LayoutGroup, LayoutPage, LayoutMap, LayoutPicture, LayoutLabel, LayoutLegend, LayoutShape, LayoutPolygon, LayoutPolyline, LayoutScaleBar, LayoutFrame, LayoutHtml, LayoutAttributeTable, LayoutTextTable, PluginItem = LayoutTextTable + 10000 } |
Item types. More... | |
Signals | |
void | multiFrameTypeAdded (int type, const QString &name) |
Emitted whenever a new multiframe type is added to the registry, with the specified type and visible name. More... | |
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. More... | |
Public Member Functions | |
QgsLayoutItemRegistry (QObject *parent=nullptr) | |
Creates a new empty item registry. More... | |
QgsLayoutItemRegistry (const QgsLayoutItemRegistry &rh)=delete | |
QgsLayoutItemRegistry cannot be copied. More... | |
~QgsLayoutItemRegistry () override | |
bool | addLayoutItemType (QgsLayoutItemAbstractMetadata *metadata) |
Registers a new layout item type. More... | |
bool | addLayoutMultiFrameType (QgsLayoutMultiFrameAbstractMetadata *metadata) |
Registers a new layout multiframe type. More... | |
QgsLayoutItem * | createItem (int type, QgsLayout *layout) const |
Creates a new instance of a layout item given the item type, and target layout. More... | |
QgsLayoutMultiFrame * | createMultiFrame (int type, QgsLayout *layout) const |
Creates a new instance of a layout multiframe given the multiframe type, and target layout. More... | |
QgsLayoutItemAbstractMetadata * | itemMetadata (int type) const |
Returns the metadata for the specified item type. More... | |
QMap< int, QString > | itemTypes () const |
Returns a map of available item types to translated name. More... | |
QgsLayoutMultiFrameAbstractMetadata * | multiFrameMetadata (int type) const |
Returns the metadata for the specified multiframe type. More... | |
QgsLayoutItemRegistry & | operator= (const QgsLayoutItemRegistry &rh)=delete |
QgsLayoutItemRegistry cannot be copied. More... | |
bool | populate () |
Populates the registry with standard item types. More... | |
void | resolvePaths (int type, QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving) const |
Resolve paths in properties of a particular symbol layer. More... | |
Registry of available layout item types.
QgsLayoutItemRegistry is not usually directly created, but rather accessed through QgsApplication::layoutItemRegistry().
A companion class, QgsLayoutItemGuiRegistry, handles the GUI behavior of layout items.
Definition at line 286 of file qgslayoutitemregistry.h.
Item types.
Enumerator | |
---|---|
LayoutItem | Base class for items. |
LayoutGroup | Grouped item. |
LayoutPage | Page items. |
LayoutMap | Map item. |
LayoutPicture | Picture item. |
LayoutLabel | Label item. |
LayoutLegend | Legend item. |
LayoutShape | Shape item. |
LayoutPolygon | Polygon shape item. |
LayoutPolyline | Polyline shape item. |
LayoutScaleBar | Scale bar item. |
LayoutFrame | Frame item, part of a QgsLayoutMultiFrame object. |
LayoutHtml | Html multiframe item. |
LayoutAttributeTable | Attribute table. |
LayoutTextTable | Preset text table. |
PluginItem | Starting point for plugin item types. |
Definition at line 293 of file qgslayoutitemregistry.h.
QgsLayoutItemRegistry::QgsLayoutItemRegistry | ( | QObject * | parent = nullptr | ) |
Creates a new empty item registry.
QgsLayoutItemRegistry is not usually directly created, but rather accessed through QgsApplication::layoutItemRegistry().
Definition at line 36 of file qgslayoutitemregistry.cpp.
|
override |
Definition at line 41 of file qgslayoutitemregistry.cpp.
|
delete |
QgsLayoutItemRegistry cannot be copied.
bool QgsLayoutItemRegistry::addLayoutItemType | ( | QgsLayoutItemAbstractMetadata * | metadata | ) |
Registers a new layout item type.
Takes ownership of the metadata instance.
Definition at line 96 of file qgslayoutitemregistry.cpp.
bool QgsLayoutItemRegistry::addLayoutMultiFrameType | ( | QgsLayoutMultiFrameAbstractMetadata * | metadata | ) |
Registers a new layout multiframe type.
Takes ownership of the metadata instance.
Definition at line 106 of file qgslayoutitemregistry.cpp.
QgsLayoutItem * QgsLayoutItemRegistry::createItem | ( | int | type, |
QgsLayout * | layout | ||
) | const |
Creates a new instance of a layout item given the item type, and target layout.
Definition at line 116 of file qgslayoutitemregistry.cpp.
QgsLayoutMultiFrame * QgsLayoutItemRegistry::createMultiFrame | ( | int | type, |
QgsLayout * | layout | ||
) | const |
Creates a new instance of a layout multiframe given the multiframe type, and target layout.
Definition at line 124 of file qgslayoutitemregistry.cpp.
QgsLayoutItemAbstractMetadata * QgsLayoutItemRegistry::itemMetadata | ( | int | type | ) | const |
Returns the metadata for the specified item type.
Returns nullptr if a corresponding type was not found in the registry.
Definition at line 86 of file qgslayoutitemregistry.cpp.
QMap< int, QString > QgsLayoutItemRegistry::itemTypes | ( | ) | const |
Returns a map of available item types to translated name.
Definition at line 144 of file qgslayoutitemregistry.cpp.
QgsLayoutMultiFrameAbstractMetadata * QgsLayoutItemRegistry::multiFrameMetadata | ( | int | type | ) | const |
Returns the metadata for the specified multiframe type.
Returns nullptr if a corresponding type was not found in the registry.
Definition at line 91 of file qgslayoutitemregistry.cpp.
|
signal |
Emitted whenever a new multiframe type is added to the registry, with the specified type and visible name.
|
delete |
QgsLayoutItemRegistry cannot be copied.
bool QgsLayoutItemRegistry::populate | ( | ) |
Populates the registry with standard item types.
If called on a non-empty registry then this will have no effect and will return false.
Definition at line 47 of file qgslayoutitemregistry.cpp.
void QgsLayoutItemRegistry::resolvePaths | ( | int | type, |
QVariantMap & | properties, | ||
const QgsPathResolver & | pathResolver, | ||
bool | saving | ||
) | const |
Resolve paths in properties of a particular symbol layer.
This normally means converting relative paths to absolute paths when loading and converting absolute paths to relative paths when saving.
Definition at line 132 of file qgslayoutitemregistry.cpp.
|
signal |
Emitted whenever a new item type is added to the registry, with the specified type and visible name.