Subgroup: Layout

Class: QgsLayoutItemMapItem

class qgis.core.QgsLayoutItemMapItem

Bases: qgis._core.QgsLayoutObject

An item which is drawn inside a QgsLayoutItemMap, e.g., a grid or map overview.

New in version 3.0: Methods

blockSignals
childEvent
children
connectNotify
createExpressionContext Creates an expression context relating to the objects’ current state.
customEvent
customProperties Return list of keys stored in custom properties for the object.
customProperty Read a custom property from the object.
dataDefinedProperties Returns a reference to the object’s property collection, used for data defined overrides.
deleteLater
disconnect
disconnectNotify
draw Draws the item on to a destination painter.
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
enabled Returns whether the item will be drawn.
event
eventFilter
findChild findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
findChildren findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
id Returns the unique id for the map item.
inherits
installEventFilter
isSignalConnected
isWidgetType
isWindowType
killTimer
layout Returns the layout the object is attached to.
map Returns the layout item map for the item.
metaObject
moveToThread
name Returns the friendly display name for the item.
objectName
parent
property
propertyDefinitions Returns the layout object property definitions.
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
readObjectPropertiesFromElement
readXml Sets the map item state from a DOM document, where element is the DOM node corresponding to a ‘LayoutMapGrid’ tag.
receivers
refresh Refreshes the object, causing a recalculation of any property overrides.
removeCustomProperty Remove a custom property from the object.
removeEventFilter
sender
senderSignalIndex
setCustomProperty Set a custom property for the object.
setDataDefinedProperties Sets the objects’s property collection, used for data defined overrides.
setEnabled Controls whether the item will be drawn.
setMap Sets the corresponding layout map for the item.
setName Sets the friendly display name for the item.
setObjectName
setParent
setProperty
signalsBlocked
startTimer
thread
timerEvent
tr
usesAdvancedEffects Returns true if the item is drawn using advanced effects, such as blend modes.
writeObjectPropertiesToElement
writeXml Stores map item state in a DOM element, where element is the DOM element corresponding to a ‘LayoutMap’ tag.

Attributes

AllProperties
BackgroundColor
BlendMode
EvaluatedValue
ExcludeFromExports
FrameColor
ItemHeight
ItemRotation
ItemWidth
LegendColumnCount
LegendTitle
MapAtlasMargin
MapLayers
MapRotation
MapScale
MapStylePreset
MapXMax
MapXMin
MapYMax
MapYMin
NoProperty
NumPages
Opacity
OriginalValue
PageNumber
PaperHeight
PaperOrientation
PaperWidth
PictureSource
PictureSvgBackgroundColor
PictureSvgStrokeColor
PictureSvgStrokeWidth
PositionX
PositionY
PresetPaperSize
ScalebarFillColor
ScalebarFillColor2
ScalebarLineColor
ScalebarLineWidth
SourceUrl
TestProperty
Transparency
changed Emitted when the object’s properties change.
destroyed destroyed(self, QObject = None) [signal]
objectNameChanged objectNameChanged(self, str) [signal]
staticMetaObject
childEvent()
connectNotify()
customEvent()
disconnectNotify()
draw(self, painter: QPainter)

Draws the item on to a destination painter.

enabled(self) → bool

Returns whether the item will be drawn.

See also

setEnabled()

id(self) → str

Returns the unique id for the map item.

isSignalConnected()
map(self) → QgsLayoutItemMap

Returns the layout item map for the item.

See also

setMap()

name(self) → str

Returns the friendly display name for the item.

See also

setName()

readObjectPropertiesFromElement()
readXml(self, element: QDomElement, doc: QDomDocument, context: QgsReadWriteContext) → bool

Sets the map item state from a DOM document, where element is the DOM node corresponding to a ‘LayoutMapGrid’ tag.

See also

writeXml()

receivers()
sender()
senderSignalIndex()
setEnabled(self, enabled: bool)

Controls whether the item will be drawn. Set enabled to true to enable drawing of the item.

See also

enabled()

setMap(self, map: QgsLayoutItemMap)

Sets the corresponding layout map for the item.

See also

map()

setName(self, name: str)

Sets the friendly display name for the item.

See also

name()

timerEvent()
usesAdvancedEffects(self) → bool

Returns true if the item is drawn using advanced effects, such as blend modes.

writeObjectPropertiesToElement()
writeXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool

Stores map item state in a DOM element, where element is the DOM element corresponding to a ‘LayoutMap’ tag.

See also

readXml()