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 forQgsLayoutItemMapItemClipPathSettings
, with the specifiedmap
parent.Methods
Returns the clipping path geometry, in the map item's coordinate space.
Returns the geometry to use for clipping the parent map, in the map item's CRS.
Returns
True
if the map content should be clipped to the associated item.Returns the feature clipping type to apply when clipping to the associated item.
To be called after all pending items have been restored from XML.
Returns
True
if labels should only be placed inside the clip path geometry.Returns
True
if the item clipping is enabled and set to a valid source item.Sets the setting's state from a DOM document, where
element
is the DOM node corresponding to a 'LayoutMap' tag.Sets whether the map content should be clipped to the associated item.
Sets the feature clipping
type
to apply when clipping to the associated item.Sets whether labels should only be placed inside the clip path geometry.
Sets the source
item
which will provide the clipping path for the map.Returns the source item which will provide the clipping path for the map, or
None
if no item is set.Returns the clip path as a map clipping region.
Stores settings in a DOM element, where
element
is the DOM element corresponding to a 'LayoutMap' tag.Signals
Emitted when the item clipping settings are changed.
- changed¶
Emitted when the item clipping settings are changed. [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.See also
- Return type
- clippedMapExtent(self) QgsGeometry ¶
Returns the geometry to use for clipping the parent map, in the map item’s CRS.
See also
- Return type
- 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
- Return type
bool
- featureClippingType(self) QgsMapClippingRegion.FeatureClippingType ¶
Returns the feature clipping type to apply when clipping to the associated item.
See also
- Return type
- finalizeRestoreFromXml(self)¶
To be called after all pending items have been restored from XML.
See also
- forceLabelsInsideClipPath(self) bool ¶
Returns
True
if labels should only be placed inside the clip path geometry.See also
- Return type
bool
- isActive(self) bool ¶
Returns
True
if the item clipping is enabled and set to a valid source item.See also
See also
- 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
See also
- Parameters
element (QDomElement) –
doc (QDomDocument) –
context (QgsReadWriteContext) –
- 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
- Parameters
enabled (bool) –
- setFeatureClippingType(self, type: QgsMapClippingRegion.FeatureClippingType)¶
Sets the feature clipping
type
to apply when clipping to the associated item.See also
- Parameters
- setForceLabelsInsideClipPath(self, forceInside: bool)¶
Sets whether labels should only be placed inside the clip path geometry.
See also
- 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 theQgsLayoutItem
.FlagProvidesClipPath flag.See also
- 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
- Return type
- timerEvent(self, QTimerEvent)¶
- toMapClippingRegion(self) QgsMapClippingRegion ¶
Returns the clip path as a map clipping region.
- Return type
- 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
- Parameters
element (QDomElement) –
document (QDomDocument) –
context (QgsReadWriteContext) –
- Return type
bool