Class: QgsLayoutItemMapAtlasClippingSettings

Contains settings relating to clipping a layout map by the current atlas feature.

Added in version 3.16.

Class Hierarchy

Inheritance diagram of qgis.core.QgsLayoutItemMapAtlasClippingSettings

Base classes

QObject

Methods

enabled

Returns True if the map content should be clipped to the current atlas feature.

featureClippingType

Returns the feature clipping type to apply when clipping to the current atlas feature.

forceLabelsInsideFeature

Returns True if labels should only be placed inside the atlas feature geometry.

layersToClip

Returns the list of map layers to clip to the atlas feature.

readXml

Sets the setting's state from a DOM document, where element is the DOM node corresponding to a 'LayoutMap' tag.

restrictToLayers

Returns True if clipping should be restricted to a subset of layers.

setEnabled

Sets whether the map content should be clipped to the current atlas feature.

setFeatureClippingType

Sets the feature clipping type to apply when clipping to the current atlas feature.

setForceLabelsInsideFeature

Sets whether labels should only be placed inside the atlas feature geometry.

setLayersToClip

Sets the list of map layers to clip to the atlas feature.

setRestrictToLayers

Sets whether clipping should be restricted to a subset of layers.

writeXml

Stores settings in a DOM element, where element is the DOM element corresponding to a 'LayoutMap' tag.

Signals

changed

Emitted when the atlas clipping settings are changed.

class qgis.core.QgsLayoutItemMapAtlasClippingSettings[source]

Bases: QObject

__init__(map: QgsLayoutItemMap | None = None)

Constructor for QgsLayoutItemMapAtlasClippingSettings, with the specified map parent.

Parameters:

map (Optional[QgsLayoutItemMap] = None)

signal changed[source]

Emitted when the atlas clipping settings are changed.

enabled(self) bool[source]

Returns True if the map content should be clipped to the current atlas feature.

See also

setEnabled()

Return type:

bool

featureClippingType(self) QgsMapClippingRegion.FeatureClippingType[source]

Returns the feature clipping type to apply when clipping to the current atlas feature.

Return type:

QgsMapClippingRegion.FeatureClippingType

forceLabelsInsideFeature(self) bool[source]

Returns True if labels should only be placed inside the atlas feature geometry.

Return type:

bool

layersToClip(self) List[QgsMapLayer]

Returns the list of map layers to clip to the atlas feature.

Note

This setting is only used if restrictToLayers() is True.

Return type:

List[QgsMapLayer]

readXml(self, element: QDomElement, doc: QDomDocument, context: QgsReadWriteContext) bool[source]

Sets the setting’s state from a DOM document, where element is the DOM node corresponding to a ‘LayoutMap’ tag.

See also

writeXml()

Parameters:
Return type:

bool

restrictToLayers(self) bool[source]

Returns True if clipping should be restricted to a subset of layers.

See also

layersToClip()

Return type:

bool

setEnabled(self, enabled: bool)[source]

Sets whether the map content should be clipped to the current atlas feature.

See also

enabled()

Parameters:

enabled (bool)

setFeatureClippingType(self, type: QgsMapClippingRegion.FeatureClippingType)[source]

Sets the feature clipping type to apply when clipping to the current atlas feature.

Parameters:

type (QgsMapClippingRegion.FeatureClippingType)

setForceLabelsInsideFeature(self, forceInside: bool)[source]

Sets whether labels should only be placed inside the atlas feature geometry.

Parameters:

forceInside (bool)

setLayersToClip(self, layers: Iterable[QgsMapLayer])[source]

Sets the list of map layers to clip to the atlas feature.

Note

This setting is only used if restrictToLayers() is True.

See also

layersToClip()

Parameters:

layers (Iterable[QgsMapLayer])

setRestrictToLayers(self, enabled: bool)[source]

Sets whether clipping should be restricted to a subset of layers.

Parameters:

enabled (bool)

writeXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool[source]

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

See also

readXml()

Parameters:
Return type:

bool