Class: QgsLayoutObject¶
-
class
qgis.core.
QgsLayoutObject
(layout: QgsLayout)¶ Bases:
PyQt5.QtCore.QObject
,qgis._core.QgsExpressionContextGenerator
Constructor for QgsLayoutObject, with the specified parent
layout
.Note
While ownership of a QgsLayoutObject is not passed to the layout, classes which are derived from QgsLayoutObject (such as QgsLayoutItem) may transfer their ownership to a layout upon construction.
A base class for objects which belong to a layout.
New in version 3.0: Enums
Methods
Creates an expression context relating to the objects’ current state.
Returns list of keys stored in custom properties for the object.
Read a custom property from the object.
Returns a reference to the object’s property collection, used for data defined overrides.
Returns the layout the object is attached to.
Returns the layout object property definitions.
Sets object properties from a DOM element
Refreshes the object, causing a recalculation of any property overrides.
Remove a custom property from the object.
Set a custom property for the object.
Sets the objects’s property collection, used for data defined overrides.
Stores object properties within an XML DOM element.
Signals
Emitted when the object’s properties change.
Attributes
-
AllProperties
= 1¶
-
AttributeTableSourceLayer
= 41¶
-
BackgroundColor
= 19¶
-
BlendMode
= 16¶
-
class
DataDefinedProperty
¶ Bases:
int
-
EvaluatedValue
= 0¶
-
ExcludeFromExports
= 17¶
-
FrameColor
= 18¶
-
ItemHeight
= 12¶
-
ItemRotation
= 13¶
-
ItemWidth
= 11¶
-
LegendColumnCount
= 36¶
-
LegendTitle
= 35¶
-
MapAtlasMargin
= 26¶
-
MapLabelMargin
= 29¶
-
MapLayers
= 27¶
-
MapRotation
= 20¶
-
MapScale
= 21¶
-
MapStylePreset
= 28¶
-
MapXMax
= 24¶
-
MapXMin
= 22¶
-
MapYMax
= 25¶
-
MapYMin
= 23¶
-
NoProperty
= 0¶
-
NumPages
= 6¶
-
Opacity
= 15¶
-
OriginalValue
= 1¶
-
PageNumber
= 8¶
-
PaperHeight
= 5¶
-
PaperOrientation
= 7¶
-
PaperWidth
= 4¶
-
PictureSource
= 30¶
-
PictureSvgBackgroundColor
= 31¶
-
PictureSvgStrokeColor
= 32¶
-
PictureSvgStrokeWidth
= 33¶
-
PositionX
= 9¶
-
PositionY
= 10¶
-
PresetPaperSize
= 3¶
-
class
PropertyValueType
¶ Bases:
int
-
ScalebarFillColor
= 37¶
-
ScalebarFillColor2
= 38¶
-
ScalebarLineColor
= 39¶
-
ScalebarLineWidth
= 40¶
-
SourceUrl
= 34¶
-
TestProperty
= 2¶
-
Transparency
= 14¶
-
changed
¶ Emitted when the object’s properties change. [signal]
-
childEvent
()¶
-
connectNotify
()¶
-
createExpressionContext
(self) → QgsExpressionContext¶ Creates an expression context relating to the objects’ current state. The context includes scopes for global, project and layout properties.
-
customEvent
()¶
-
customProperties
(self) → List[str]¶ Returns list of keys stored in custom properties for the object.
See also
See also
See also
-
customProperty
(self, key: str, defaultValue: Any = None) → Any¶ Read a custom property from the object.
- Parameters
key – property key
defaultValue – default value to return if property with matching key does not exist
- Returns
value of matching property
See also
See also
See also
-
dataDefinedProperties
(self) → QgsPropertyCollection¶ Returns a reference to the object’s property collection, used for data defined overrides.
See also
-
disconnectNotify
()¶
-
isSignalConnected
()¶
-
layout
(self) → QgsLayout¶ Returns the layout the object is attached to.
-
propertyDefinitions
() → object¶ Returns the layout object property definitions.
-
readObjectPropertiesFromElement
(self, parentElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool¶ Sets object properties from a DOM element
- Parameters
parentElement – is the parent DOM element for the object
document – DOM document
context – read write context
- Returns
true if read was successful
See also
-
receivers
()¶
-
refresh
(self)¶ Refreshes the object, causing a recalculation of any property overrides.
-
removeCustomProperty
(self, key: str)¶ Remove a custom property from the object.
- Parameters
key – property key
See also
See also
See also
-
sender
()¶
-
senderSignalIndex
()¶
-
setCustomProperty
(self, key: str, value: Any)¶ Set a custom property for the object.
- Parameters
key – property key. If a property with the same key already exists it will be overwritten.
value – property value
See also
See also
See also
-
setDataDefinedProperties
(self, collection: QgsPropertyCollection)¶ Sets the objects’s property collection, used for data defined overrides.
- Parameters
collection – property collection. Existing properties will be replaced.
See also
See also
DataDefinedProperty
-
timerEvent
()¶
-
writeObjectPropertiesToElement
(self, parentElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool¶ Stores object properties within an XML DOM element.
- Parameters
parentElement – is the parent DOM element to store the object’s properties in
document – DOM document
context – read write context
- Returns
true if write was successful
See also
-