27void QgsLayoutObject::initPropertyDefinitions()
29 if ( !sPropertyDefinitions.isEmpty() )
37 "|<b>B5</b>|<b>B4</b>|<b>B3</b>|<b>B2</b>|<b>B1</b>|<b>B0</b>"
38 "|<b>Legal</b>|<b>Ansi A</b>|<b>Ansi B</b>|<b>Ansi C</b>|<b>Ansi D</b>|<b>Ansi E</b>"
39 "|<b>Arch A</b>|<b>Arch B</b>|<b>Arch C</b>|<b>Arch D</b>|<b>Arch E</b>|<b>Arch E1</b>]"
129 QgsLayoutObject::initPropertyDefinitions();
130 return sPropertyDefinitions;
234 initPropertyDefinitions();
277 return mLayout->createExpressionContext();
287 if ( parentElement.isNull() )
293 QDomElement objectElement = document.createElement( QStringLiteral(
"LayoutObject" ) );
295 QDomElement ddPropsElement = document.createElement( QStringLiteral(
"dataDefinedProperties" ) );
297 objectElement.appendChild( ddPropsElement );
302 parentElement.appendChild( objectElement );
309 if ( parentElement.isNull() )
314 const QDomNodeList objectNodeList = parentElement.elementsByTagName( QStringLiteral(
"LayoutObject" ) );
315 if ( objectNodeList.size() < 1 )
319 const QDomElement objectElement = objectNodeList.at( 0 ).toElement();
321 const QDomNode propsNode = objectElement.namedItem( QStringLiteral(
"dataDefinedProperties" ) );
322 if ( !propsNode.isNull() )
virtual bool readXml(const QDomElement &collectionElem, const QgsPropertiesDefinition &definitions)
Reads property collection state from an XML element.
virtual bool writeXml(QDomElement &collectionElem, const QgsPropertiesDefinition &definitions) const
Writes the current state of the property collection into an XML element.
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QStringList customProperties() const
Returns list of keys stored in custom properties for the object.
QVariant customProperty(const QString &key, const QVariant &defaultValue=QVariant()) const
Read a custom property from the object.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the layout object property definitions.
QgsObjectCustomProperties mCustomProperties
Custom properties for object.
QgsPropertyCollection mDataDefinedProperties
bool readObjectPropertiesFromElement(const QDomElement &parentElement, const QDomDocument &document, const QgsReadWriteContext &context)
Sets object properties from a DOM element.
const QgsLayout * layout() const
Returns the layout the object is attached to.
void setCustomProperty(const QString &key, const QVariant &value)
Set a custom property for the object.
virtual void refresh()
Refreshes the object, causing a recalculation of any property overrides.
QPointer< QgsLayout > mLayout
DataDefinedProperty
Data defined properties for different item types.
@ TestProperty
Dummy property with no effect on item.
@ MapGridIntervalX
Map grid interval X.
@ MapGridAnnotationDisplayBottom
Map annotation display bottom.
@ ElevationProfileTolerance
Tolerance distance for elevation profiles (since QGIS 3.30)
@ MapGridIntervalY
Map grid interval Y.
@ MapYMin
Map extent y minimum.
@ PictureSvgStrokeColor
SVG stroke color.
@ PaperOrientation
Paper orientation.
@ MapGridFrameSize
Map grid frame size.
@ ElevationProfileElevationLabelInterval
Label interval for elevation profile elevation axis (since QGIS 3.30)
@ LegendTitle
Legend title.
@ MapStylePreset
Layer and style map theme.
@ AttributeTableSourceLayer
Attribute table source layer.
@ ItemWidth
Width of item.
@ ScalebarMinimumWidth
Scalebar segment minimum width (since QGIS 3.26)
@ PaperHeight
Paper height (deprecated)
@ ItemHeight
Height of item.
@ ElevationProfileDistanceMajorInterval
Major grid line interval for elevation profile distance axis (since QGIS 3.30)
@ MarginTop
Top margin (since QGIS 3.30)
@ ElevationProfileDistanceLabelInterval
Label interval for elevation profile distance axis (since QGIS 3.30)
@ MapXMax
Map extent x maximum.
@ ElevationProfileElevationMinorInterval
Minor grid line interval for elevation profile elevation axis (since QGIS 3.30)
@ BlendMode
Item blend mode.
@ ScalebarFillColor2
Scalebar secondary fill color (deprecated, use data defined properties on scalebar fill symbol 2 inst...
@ ScalebarLineWidth
Scalebar line width (deprecated, use data defined properties on scalebar line symbol instead)
@ StartDateTime
Temporal range's start DateTime.
@ ScalebarSegmentWidth
Scalebar width in map units of a single segment (since QGIS 3.26)
@ AllProperties
All properties for item.
@ MarginLeft
Left margin (since QGIS 3.30)
@ PositionY
Y position on page.
@ MapGridFrameDivisionsBottom
Map frame division display bottom.
@ ElevationProfileMaximumDistance
Maximum distance value for elevation profile (since QGIS 3.30)
@ MapGridAnnotationDisplayRight
Map annotation display right.
@ SourceUrl
Html source url.
@ EndDateTime
Temporal range's end DateTime.
@ Transparency
Item transparency (deprecated)
@ ScalebarFillColor
Scalebar fill color (deprecated, use data defined properties on scalebar fill symbol 1 instead)
@ MapGridFrameMargin
Map grid frame margin.
@ MapGridOffsetX
Map grid offset X.
@ MapGridLabelDistance
Map grid label distance.
@ MapAtlasMargin
Map atlas margin.
@ MapGridAnnotationDisplayLeft
Map annotation display left.
@ MapYMax
Map extent y maximum.
@ PageNumber
Page number for item placement.
@ MapXMin
Map extent x minimum.
@ ExcludeFromExports
Exclude item from exports.
@ MarginRight
Right margin (since QGIS 3.30)
@ PictureSvgStrokeWidth
SVG stroke width.
@ MapGridFrameDivisionsLeft
Map frame division display left.
@ ElevationProfileMinimumElevation
Minimum elevation value for elevation profile (since QGIS 3.30)
@ MapGridEnabled
Map grid enabled.
@ BackgroundColor
Item background color.
@ ElevationProfileElevationMajorInterval
Major grid line interval for elevation profile elevation axis (since QGIS 3.30)
@ LegendColumnCount
Legend column count.
@ ScalebarMaximumWidth
Scalebar segment maximum width (since QGIS 3.26)
@ MapLabelMargin
Map label margin.
@ ItemRotation
Rotation of item.
@ MapLayers
Map layer set.
@ ScalebarLineColor
Scalebar line color (deprecated, use data defined properties on scalebar line symbol instead)
@ ScalebarHeight
Scalebar height (since QGIS 3.26)
@ ScalebarRightSegments
Number of segments on the right of 0 (since QGIS 3.26)
@ MapGridFrameLineThickness
Map grid frame line thickness.
@ PictureSvgBackgroundColor
SVG background color.
@ MapGridFrameDivisionsRight
Map frame division display right.
@ ElevationProfileMinimumDistance
Minimum distance value for elevation profile (since QGIS 3.30)
@ PictureSource
Picture source url.
@ MapGridFrameDivisionsTop
Map frame division display top.
@ PaperWidth
Paper width (deprecated)
@ MarginBottom
Bottom margin (since QGIS 3.30)
@ ElevationProfileDistanceMinorInterval
Minor grid line interval for elevation profile distance axis (since QGIS 3.30)
@ PresetPaperSize
Preset paper size for composition.
@ PositionX
X position on page.
@ ElevationProfileMaximumElevation
Maximum elevation value for elevation profile (since QGIS 3.30)
@ FrameColor
Item frame color.
@ MapGridCrossSize
Map grid cross size.
@ NumPages
Number of pages in composition (deprecated)
@ MapGridOffsetY
Map grid offset Y.
@ MapGridAnnotationDisplayTop
Map annotation display top.
@ MapRotation
Map rotation.
@ ScalebarSubdivisionHeight
Scalebar subdivision height (since QGIS 3.26)
@ ScalebarRightSegmentSubdivisions
Number of subdivisions per segment on right of 0 (since QGIS 3.26)
@ ScalebarLeftSegments
Number of segments on the left of 0 (since QGIS 3.26)
QgsExpressionContext createExpressionContext() const override
Creates an expression context relating to the objects' current state.
void removeCustomProperty(const QString &key)
Remove a custom property from the object.
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.
static bool propertyAssociatesWithParentMultiframe(DataDefinedProperty property)
Returns true if the specified property key is normally associated with the parent QgsLayoutMultiFrame...
void changed()
Emitted certain settings in the context is changed, e.g.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
void refreshed()
Emitted when the layout has been refreshed and items should also be refreshed and updated.
void setValue(const QString &key, const QVariant &value)
Add an entry to the store with the specified key.
QStringList keys() const
Returns a list of all stored keys.
void writeXml(QDomNode &parentNode, QDomDocument &doc) const
Writes the store contents to an XML node.
void remove(const QString &key)
Removes a key (entry) from the store.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
Returns the value for the given key.
void readXml(const QDomNode &parentNode, const QString &keyStartsWith=QString())
Read store contents from an XML node.
Definition for a property.
@ Double
Double value (including negative values)
@ StrokeWidth
Line stroke width.
@ String
Any string value.
@ DateTime
DateTime value.
@ IntegerPositiveGreaterZero
Non-zero positive integer values.
@ IntegerPositive
Positive integer values (including 0)
@ Rotation
Rotation (value between 0-360 degrees)
@ ColorWithAlpha
Color with alpha channel.
@ DoublePositive
Positive double value (including 0)
@ DataTypeString
Property requires a string value.
The class is used as a container of context for various read/write operations on other objects.
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.