17#ifndef QGSLAYOUTOBJECT_H
18#define QGSLAYOUTOBJECT_H
59 if (
QgsLayoutItem *item = qobject_cast< QgsLayoutItem * >( sipCpp ) )
63 switch ( item->type() )
71 case QGraphicsItem::UserType + 101:
72 sipType = sipType_QgsLayoutItemGroup;
75 case QGraphicsItem::UserType + 102:
76 sipType = sipType_QgsLayoutItemPage;
79 case QGraphicsItem::UserType + 103:
80 sipType = sipType_QgsLayoutItemMap;
83 case QGraphicsItem::UserType + 104:
84 sipType = sipType_QgsLayoutItemPicture;
87 case QGraphicsItem::UserType + 105:
88 sipType = sipType_QgsLayoutItemLabel;
91 case QGraphicsItem::UserType + 106:
92 sipType = sipType_QgsLayoutItemLegend;
95 case QGraphicsItem::UserType + 107:
96 sipType = sipType_QgsLayoutItemShape;
99 case QGraphicsItem::UserType + 108:
100 sipType = sipType_QgsLayoutItemPolygon;
103 case QGraphicsItem::UserType + 109:
104 sipType = sipType_QgsLayoutItemPolyline;
107 case QGraphicsItem::UserType + 110:
108 sipType = sipType_QgsLayoutItemScaleBar;
111 case QGraphicsItem::UserType + 111:
112 sipType = sipType_QgsLayoutFrame;
115 case QGraphicsItem::UserType + 117:
116 sipType = sipType_QgsLayoutItemMarker;
119 case QGraphicsItem::UserType + 118:
120 sipType = sipType_QgsLayoutItemElevationProfile;
123 case QGraphicsItem::UserType + 119:
124 sipType = sipType_QgsLayoutItemChart;
131 sipType = sipType_QgsLayoutItem;
193 MapGridLabelDistance,
195 MapGridFrameLineThickness,
196 MapGridAnnotationDisplayLeft,
197 MapGridAnnotationDisplayRight,
198 MapGridAnnotationDisplayTop,
199 MapGridAnnotationDisplayBottom,
200 MapGridFrameDivisionsLeft,
201 MapGridFrameDivisionsRight,
202 MapGridFrameDivisionsTop,
203 MapGridFrameDivisionsBottom,
204 MapGridDrawAnnotation,
212 PictureSvgBackgroundColor,
213 PictureSvgStrokeColor,
214 PictureSvgStrokeWidth,
222 ScalebarLeftSegments,
223 ScalebarRightSegments,
224 ScalebarSegmentWidth,
225 ScalebarMinimumWidth,
226 ScalebarMaximumWidth,
228 ScalebarRightSegmentSubdivisions,
229 ScalebarSubdivisionHeight,
235 AttributeTableSourceLayer,
236 ElevationProfileTolerance,
237 ElevationProfileDistanceMajorInterval,
238 ElevationProfileDistanceMinorInterval,
239 ElevationProfileDistanceLabelInterval,
240 ElevationProfileElevationMajorInterval,
241 ElevationProfileElevationMinorInterval,
242 ElevationProfileElevationLabelInterval,
243 ElevationProfileMinimumDistance,
244 ElevationProfileMaximumDistance,
245 ElevationProfileMinimumElevation,
246 ElevationProfileMaximumElevation,
277 static bool propertyAssociatesWithParentMultiframe( DataDefinedProperty property );
327 void setCustomProperty(
const QString &key,
const QVariant &value );
338 QVariant customProperty(
const QString &key,
const QVariant &defaultValue = QVariant() )
const;
347 void removeCustomProperty(
const QString &key );
355 QStringList customProperties()
const;
411 static void initPropertyDefinitions();
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Base class for frame items, which form a layout multiframe item.
A layout item subclass that renders chart plots.
A layout item subclass for elevation profile plots.
A container for grouping several QgsLayoutItems.
A layout item subclass for text labels.
A layout item subclass for map legends.
Layout graphical items for displaying a map.
A layout item for showing marker symbols.
Item representing the paper in a layout.
A layout item subclass that displays SVG files or raster format images (jpg, png, ....
Layout item for node based polygon shapes.
Layout item for node based polyline shapes.
A layout item subclass for scale bars.
Layout item for basic filled shapes (e.g.
Base class for graphical items within a QgsLayout.
A base class for objects which belong to a layout.
friend class TestQgsLayoutObject
QgsObjectCustomProperties mCustomProperties
Custom properties for object.
QgsPropertyCollection mDataDefinedProperties
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the object's property collection, used for data defined overrides.
bool readObjectPropertiesFromElement(const QDomElement &parentElement, const QDomDocument &document, const QgsReadWriteContext &context)
Sets object properties from a DOM element.
void changed()
Emitted when the object's properties change.
virtual void refresh()
Refreshes the object, causing a recalculation of any property overrides.
QPointer< QgsLayout > mLayout
DataDefinedProperty
Data defined properties for different item types.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the objects's property collection, used for data defined overrides.
friend class QgsCompositionConverter
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the object's property collection, used for data defined overrides.
QgsLayoutObject(QgsLayout *layout)
Constructor for QgsLayoutObject, with the specified parent layout.
bool writeObjectPropertiesToElement(QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const
Stores object properties within an XML DOM element.
PropertyValueType
Specifies whether the value returned by a function should be the original, user set value,...
@ OriginalValue
Return the original, user set value.
@ EvaluatedValue
Return the current evaluated value for the property.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML i...
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
A container for the context for various read/write operations on objects.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.