29 void QgsLayoutObject::initPropertyDefinitions()
31 if ( !sPropertyDefinitions.isEmpty() )
39 "|<b>B5</b>|<b>B4</b>|<b>B3</b>|<b>B2</b>|<b>B1</b>|<b>B0</b>" 40 "|<b>Legal</b>|<b>Ansi A</b>|<b>Ansi B</b>|<b>Ansi C</b>|<b>Ansi D</b>|<b>Ansi E</b>" 41 "|<b>Arch A</b>|<b>Arch B</b>|<b>Arch C</b>|<b>Arch D</b>|<b>Arch E</b>|<b>Arch E1</b>]" 86 QgsLayoutObject::initPropertyDefinitions();
87 return sPropertyDefinitions;
94 initPropertyDefinitions();
137 return mLayout->createExpressionContext();
147 if ( parentElement.isNull() )
153 QDomElement objectElement = document.createElement( QStringLiteral(
"LayoutObject" ) );
155 QDomElement ddPropsElement = document.createElement( QStringLiteral(
"dataDefinedProperties" ) );
157 objectElement.appendChild( ddPropsElement );
162 parentElement.appendChild( objectElement );
168 Q_UNUSED( document );
169 if ( parentElement.isNull() )
174 QDomNodeList objectNodeList = parentElement.elementsByTagName( QStringLiteral(
"LayoutObject" ) );
175 if ( objectNodeList.size() < 1 )
179 QDomElement objectElement = objectNodeList.at( 0 ).toElement();
181 QDomNode propsNode = objectElement.namedItem( QStringLiteral(
"dataDefinedProperties" ) );
182 if ( !propsNode.isNull() )
The class is used as a container of context for various read/write operations on other objects...
QStringList customProperties() const
Returns list of keys stored in custom properties for the object.
QgsExpressionContext createExpressionContext() const override
Creates an expression context relating to the objects' current state.
Positive integer values (including 0)
virtual bool writeXml(QDomElement &collectionElem, const QgsPropertiesDefinition &definitions) const
Writes the current state of the property collection into an XML element.
bool readObjectPropertiesFromElement(const QDomElement &parentElement, const QDomDocument &document, const QgsReadWriteContext &context)
Sets object properties from a DOM element.
void readXml(const QDomNode &parentNode, const QString &keyStartsWith=QString())
Read store contents from XML.
virtual bool readXml(const QDomElement &collectionElem, const QgsPropertiesDefinition &definitions)
Reads property collection state from an XML element.
Layer and style map theme.
QgsObjectCustomProperties mCustomProperties
Custom properties for object.
Exclude item from exports.
void changed()
Emitted certain settings in the context is changed, e.g.
Non-zero positive integer values.
void setCustomProperty(const QString &key, const QVariant &value)
Set a custom property for the object.
Color with alpha channel.
Positive double value (including 0)
void remove(const QString &key)
Remove a key (entry) from the store.
Rotation (value between 0-360 degrees)
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the layout object property definitions.
Dummy property with no effect on item.
Number of pages in composition (deprecated)
Attribute table source layer.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
Returns value for the given key. If the key is not stored, default value will be used.
void setValue(const QString &key, const QVariant &value)
Add an entry to the store. If the entry with the keys exists already, it will be overwritten.
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context...
Scalebar secondary fill color.
QgsPropertyCollection mDataDefinedProperties
Item transparency (deprecated)
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QStringList keys() const
Returns list of stored keys.
QPointer< QgsLayout > mLayout
Page number for item placement.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Double value (including negative values)
Definition for a property.
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
void removeCustomProperty(const QString &key)
Remove a custom property from the object.
Property requires a string value.
void writeXml(QDomNode &parentNode, QDomDocument &doc) const
Write store contents to XML.
void refreshed()
Is emitted when the layout has been refreshed and items should also be refreshed and updated...
Preset paper size for composition.
Paper height (deprecated)
bool writeObjectPropertiesToElement(QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const
Stores object properties within an XML DOM element.
const QgsLayout * layout() const
Returns the layout the object is attached to.
QgsLayoutObject(QgsLayout *layout)
Constructor for QgsLayoutObject, with the specified parent layout.
virtual void refresh()
Refreshes the object, causing a recalculation of any property overrides.
QVariant customProperty(const QString &key, const QVariant &defaultValue=QVariant()) const
Read a custom property from the object.