17 #ifndef QGSLAYOUTOBJECT_H 18 #define QGSLAYOUTOBJECT_H 20 #include "qgis_core.h" 58 if (
QgsLayoutItem *item = qobject_cast< QgsLayoutItem * >( sipCpp ) )
62 switch ( item->type() )
70 case QGraphicsItem::UserType + 101:
71 sipType = sipType_QgsLayoutItemGroup;
74 case QGraphicsItem::UserType + 102:
75 sipType = sipType_QgsLayoutItemPage;
78 case QGraphicsItem::UserType + 103:
79 sipType = sipType_QgsLayoutItemMap;
82 case QGraphicsItem::UserType + 104:
83 sipType = sipType_QgsLayoutItemPicture;
86 case QGraphicsItem::UserType + 105:
87 sipType = sipType_QgsLayoutItemLabel;
90 case QGraphicsItem::UserType + 106:
91 sipType = sipType_QgsLayoutItemLegend;
94 case QGraphicsItem::UserType + 107:
95 sipType = sipType_QgsLayoutItemShape;
98 case QGraphicsItem::UserType + 108:
99 sipType = sipType_QgsLayoutItemPolygon;
102 case QGraphicsItem::UserType + 109:
103 sipType = sipType_QgsLayoutItemPolyline;
106 case QGraphicsItem::UserType + 110:
107 sipType = sipType_QgsLayoutItemScaleBar;
110 case QGraphicsItem::UserType + 111:
111 sipType = sipType_QgsLayoutFrame;
118 sipType = sipType_QgsLayoutItem;
260 void setCustomProperty(
const QString &key,
const QVariant &value );
271 QVariant customProperty(
const QString &key,
const QVariant &defaultValue = QVariant() )
const;
280 void removeCustomProperty(
const QString &key );
288 QStringList customProperties()
const;
320 bool writeObjectPropertiesToElement( QDomElement &parentElement, QDomDocument &document,
const QgsReadWriteContext &context )
const;
330 bool readObjectPropertiesFromElement(
const QDomElement &parentElement,
const QDomDocument &document,
const QgsReadWriteContext &context );
344 static void initPropertyDefinitions();
346 friend class TestQgsLayoutObject;
350 #endif //QGSLAYOUTOBJECT_H
The class is used as a container of context for various read/write operations on other objects...
Base class for graphical items within a QgsLayout.
A layout item subclass for text labels.
Layer and style map theme.
QgsObjectCustomProperties mCustomProperties
Custom properties for object.
Exclude item from exports.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the object's property collection, used for data defined overrides.
A container for grouping several QgsLayoutItems.
A layout item subclass that displays SVG files or raster format images (jpg, png, ...
Layout item for node based polygon shapes.
Dummy property with no effect on item.
Number of pages in composition (deprecated)
PropertyValueType
Specifies whether the value returned by a function should be the original, user set value...
Attribute table source layer.
Map grid frame line thickness.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Layout graphical items for displaying a map.
Layout item for node based polyline shapes.
Scalebar secondary fill color.
QgsPropertyCollection mDataDefinedProperties
Item transparency (deprecated)
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Layout item for basic filled shapes (e.g.
QPointer< QgsLayout > mLayout
Page number for item placement.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
Abstract interface for generating an expression context.
QgsCompositionConverter class converts a QGIS 2.x composition to a QGIS 3.x layout.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the objects's property collection, used for data defined overrides.
Preset paper size for composition.
Paper height (deprecated)
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML i...
A layout item subclass for scale bars.
A base class for objects which belong to a layout.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
A layout item subclass for map legends.
virtual void refresh()
Refreshes the object, causing a recalculation of any property overrides.
DataDefinedProperty
Data defined properties for different item types.
Base class for frame items, which form a layout multiframe item.
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the object's property collection, used for data defined overrides.
Item representing the paper in a layout.