Class: QgsLayoutItemMapItemClipPathSettings

class qgis.core.QgsLayoutItemMapItemClipPathSettings

Bases: PyQt5.QtCore.QObject

Contains settings relating to clipping a layout map by another layout item.

New in version 3.16.

QgsLayoutItemMapItemClipPathSettings(map: QgsLayoutItemMap = None) Constructor for QgsLayoutItemMapItemClipPathSettings, with the specified map parent.

Methods

childEvent

clipPathInMapItemCoordinates

Returns the clipping path geometry, in the map item's coordinate space.

clippedMapExtent

Returns the geometry to use for clipping the parent map, in the map item's CRS.

connectNotify

customEvent

disconnectNotify

enabled

Returns True if the map content should be clipped to the associated item.

featureClippingType

Returns the feature clipping type to apply when clipping to the associated item.

finalizeRestoreFromXml

To be called after all pending items have been restored from XML.

forceLabelsInsideClipPath

Returns True if labels should only be placed inside the clip path geometry.

isActive

Returns True if the item clipping is enabled and set to a valid source item.

isSignalConnected

readXml

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

receivers

sender

senderSignalIndex

setEnabled

Sets whether the map content should be clipped to the associated item.

setFeatureClippingType

Sets the feature clipping type to apply when clipping to the associated item.

setForceLabelsInsideClipPath

Sets whether labels should only be placed inside the clip path geometry.

setSourceItem

Sets the source item which will provide the clipping path for the map.

sourceItem

Returns the source item which will provide the clipping path for the map, or None if no item is set.

timerEvent

toMapClippingRegion

Returns the clip path as a map clipping region.

writeXml

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

Signals

changed

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

changed

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

childEvent(self, QChildEvent)
clipPathInMapItemCoordinates(self) QgsGeometry

Returns the clipping path geometry, in the map item’s coordinate space.

Warning

The return path is not in geographic coordinates, rather the map layout item’s QGraphicsItem coordinate space. Use clippedMapExtent() to retrieve the clip path in the map’s CRS.

Return type:

QgsGeometry

clippedMapExtent(self) QgsGeometry

Returns the geometry to use for clipping the parent map, in the map item’s CRS.

Return type:

QgsGeometry

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
enabled(self) bool

Returns True if the map content should be clipped to the associated item.

See also

setEnabled()

Return type:

bool

featureClippingType(self) QgsMapClippingRegion.FeatureClippingType

Returns the feature clipping type to apply when clipping to the associated item.

Return type:

QgsMapClippingRegion.FeatureClippingType

finalizeRestoreFromXml(self)

To be called after all pending items have been restored from XML.

See also

readXml()

forceLabelsInsideClipPath(self) bool

Returns True if labels should only be placed inside the clip path geometry.

Return type:

bool

isActive(self) bool

Returns True if the item clipping is enabled and set to a valid source item.

See also

enabled()

See also

sourceItem()

Return type:

bool

isSignalConnected(self, QMetaMethod) bool
readXml(self, element: QDomElement, doc: QDomDocument, context: QgsReadWriteContext) bool

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

receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
setEnabled(self, enabled: bool)

Sets whether the map content should be clipped to the associated item.

See also

enabled()

Parameters:

enabled (bool) –

setFeatureClippingType(self, type: QgsMapClippingRegion.FeatureClippingType)

Sets the feature clipping type to apply when clipping to the associated item.

Parameters:

type (QgsMapClippingRegion.FeatureClippingType) –

setForceLabelsInsideClipPath(self, forceInside: bool)

Sets whether labels should only be placed inside the clip path geometry.

Parameters:

forceInside (bool) –

setSourceItem(self, item: QgsLayoutItem)

Sets the source item which will provide the clipping path for the map.

The specified item must return the QgsLayoutItem.FlagProvidesClipPath flag.

See also

sourceItem()

Parameters:

item (QgsLayoutItem) –

sourceItem(self) QgsLayoutItem

Returns the source item which will provide the clipping path for the map, or None if no item is set.

See also

setSourceItem()

Return type:

QgsLayoutItem

timerEvent(self, QTimerEvent)
toMapClippingRegion(self) QgsMapClippingRegion

Returns the clip path as a map clipping region.

Return type:

QgsMapClippingRegion

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

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

See also

readXml()

Parameters:
Return type:

bool