Class: QgsLayoutItemElevationProfile¶
- class qgis.core.QgsLayoutItemElevationProfile¶
Bases:
QgsLayoutItem
A layout item subclass for elevation profile plots.
New in version 3.30.
QgsLayoutItemElevationProfile(layout:
QgsLayout
) Constructor forQgsLayoutItemElevationProfile
, with the specified parentlayout
.Methods
Adjusts the specified
point
at which areference
position of the item sits and returns the top left corner of the item, if reference point were placed at the specified position.Applies any present data defined size overrides to the specified layout
size
.Applies any item-specific size constraint handling to a given
targetSize
in layout units.Returns whether the profile curve is set to follow the current atlas feature.
Returns a new elevation profile item for the specified
layout
.Returns the desired Coordinate Reference System for the profile.
Returns the units for the distance axis.
- param context:
Draws the background for the item.
Draws a debugging rectangle of the item's current bounds within the specified painter.
Draws the frame around the item.
Draws a "refreshing" overlay icon on the item.
Returns the path to use when drawing the item's frame or background.
- rtype:
QIcon
- rtype:
QgsLayoutItem.Flags
Returns the list of map layers participating in the elevation profile.
- param painter:
Returns a reference to the elevation plot object, which can be used to set plot appearance and properties.
Returns the current position (in layout units) of a
reference
point for the item.Returns the cross section profile curve, which represents the line along which the profile should be generated.
Returns the profile request used to generate the elevation profile.
Sets object properties from a DOM element
- param element:
Refresh item's background color, considering data defined colors.
Refresh item's blend mode, considering data defined blend mode.
- param property:
Refresh item's frame, considering data defined colors and frame size.
Refreshes an item's position by rechecking it against any possible overrides such as data defined positioning.
Refreshes an item's rotation by rechecking it against any possible overrides such as data defined rotation.
Refreshes an item's size by rechecking it against any possible item fixed or minimum sizes.
Refresh item's opacity, considering data defined opacity.
Sets whether the profile curve will follow the current atlas feature.
Sets the desired Coordinate Reference System (
crs
) for the profile.Sets the
unit
for the distance axis.Sets a fixed
size
for the layout item, which prevents it from being freely resized.Sets the list of map
layers
participating in the elevation profile.Sets the minimum allowed
size
for the layout item.Sets the cross section profile
curve
, which represents the line along which the profile should be generated.Sets the tolerance of the request (in
crs()
units).Returns the tolerance of the request (in
crs()
units).Returns the position for the reference point of the item, if the top-left of the item was placed at the specified
point
.- rtype:
int
Stores object properties within an XML DOM element.
- param element:
- adjustPointForReferencePosition(self, point: QPointF | QPoint, size: QSizeF, reference: QgsLayoutItem.ReferencePoint) QPointF ¶
Adjusts the specified
point
at which areference
position of the item sits and returns the top left corner of the item, if reference point were placed at the specified position.
- applyDataDefinedSize(self, size: QgsLayoutSize) QgsLayoutSize ¶
Applies any present data defined size overrides to the specified layout
size
.
- applyItemSizeConstraint(self, targetSize: QSizeF) QSizeF ¶
Applies any item-specific size constraint handling to a given
targetSize
in layout units. Subclasses can override this method if they need to apply advanced logic regarding item sizes, which cannot be covered bysetFixedSize()
orsetMinimumSize()
. Item size constraints are applied after fixed, minimum and data defined size constraints.See also
See also
- atlasDriven(self) bool ¶
Returns whether the profile curve is set to follow the current atlas feature.
See also
- Return type:
bool
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QGraphicsSceneContextMenuEvent)¶
- create(layout: QgsLayout) QgsLayoutItemElevationProfile ¶
Returns a new elevation profile item for the specified
layout
.The caller takes responsibility for deleting the returned object.
- Parameters:
layout (QgsLayout) –
- Return type:
- crs(self) QgsCoordinateReferenceSystem ¶
Returns the desired Coordinate Reference System for the profile.
This also represents the CRS associated with the
profileCurve()
.See also
- Return type:
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- distanceUnit(self) Qgis.DistanceUnit ¶
Returns the units for the distance axis.
See also
New in version 3.32.
- Return type:
- dragEnterEvent(self, QGraphicsSceneDragDropEvent)¶
- dragLeaveEvent(self, QGraphicsSceneDragDropEvent)¶
- dragMoveEvent(self, QGraphicsSceneDragDropEvent)¶
- draw(self, context: QgsLayoutItemRenderContext)¶
- Parameters:
context (QgsLayoutItemRenderContext) –
- drawBackground(self, context: QgsRenderContext)¶
Draws the background for the item.
See also
- drawDebugRect(self, painter: QPainter)¶
Draws a debugging rectangle of the item’s current bounds within the specified painter.
- Parameters:
painter – destination QPainter
- drawFrame(self, context: QgsRenderContext)¶
Draws the frame around the item.
See also
- drawRefreshingOverlay(self, painter: QPainter, itemStyle: QStyleOptionGraphicsItem)¶
Draws a “refreshing” overlay icon on the item.
New in version 3.32.
- dropEvent(self, QGraphicsSceneDragDropEvent)¶
- focusInEvent(self, QFocusEvent)¶
- focusOutEvent(self, QFocusEvent)¶
- framePath(self) QPainterPath ¶
Returns the path to use when drawing the item’s frame or background.
See also
See also
New in version 3.16.
- hoverEnterEvent(self, QGraphicsSceneHoverEvent)¶
- hoverLeaveEvent(self, QGraphicsSceneHoverEvent)¶
- hoverMoveEvent(self, QGraphicsSceneHoverEvent)¶
- icon(self) QIcon ¶
- Return type:
QIcon
- inputMethodEvent(self, QInputMethodEvent)¶
- inputMethodQuery(self, Qt.InputMethodQuery) Any ¶
- invalidateCache(self)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- itemChange(self, QGraphicsItem.GraphicsItemChange, Any) Any ¶
- itemFlags(self) QgsLayoutItem.Flags ¶
- Return type:
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- layers(self) List[QgsMapLayer] ¶
Returns the list of map layers participating in the elevation profile.
See also
- Return type:
List[QgsMapLayer]
- mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)¶
- mouseMoveEvent(self, QGraphicsSceneMouseEvent)¶
- mousePressEvent(self, QGraphicsSceneMouseEvent)¶
- mouseReleaseEvent(self, QGraphicsSceneMouseEvent)¶
- paint(self, painter: QPainter, itemStyle: QStyleOptionGraphicsItem, pWidget: QWidget)¶
- Parameters:
painter (QPainter) –
itemStyle (QStyleOptionGraphicsItem) –
pWidget (QWidget) –
- plot(self) Qgs2DPlot ¶
Returns a reference to the elevation plot object, which can be used to set plot appearance and properties.
- Return type:
- positionAtReferencePoint(self, reference: QgsLayoutItem.ReferencePoint) QPointF ¶
Returns the current position (in layout units) of a
reference
point for the item.
- prepareGeometryChange(self)¶
- profileCurve(self) QgsCurve ¶
Returns the cross section profile curve, which represents the line along which the profile should be generated.
The coordinate reference system of the curve is retrieved via
crs()
.See also
- Return type:
- profileRequest(self) QgsProfileRequest ¶
Returns the profile request used to generate the elevation profile.
- Return type:
- 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
- readPropertiesFromElement(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool ¶
- Parameters:
element (QDomElement) –
document (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
bool
- receivers(self, PYQT_SIGNAL) int ¶
- refresh(self)¶
- refreshBackgroundColor(self, updateItem: bool = True)¶
Refresh item’s background color, considering data defined colors. If
updateItem
is set toFalse
, the item will not be automatically updated after the frame color is set and a later call toupdate()
must be made.
- refreshBlendMode(self)¶
Refresh item’s blend mode, considering data defined blend mode.
- refreshDataDefinedProperty(self, property: QgsLayoutObject.DataDefinedProperty = QgsLayoutObject.AllProperties)¶
- Parameters:
property (QgsLayoutObject.DataDefinedProperty = QgsLayoutObject.AllProperties) –
- refreshFrame(self, updateItem: bool = True)¶
Refresh item’s frame, considering data defined colors and frame size. If
updateItem
is set toFalse
, the item will not be automatically updated after the frame is set and a later call toupdate()
must be made.
- refreshItemPosition(self)¶
Refreshes an item’s position by rechecking it against any possible overrides such as data defined positioning.
See also
- refreshItemRotation(self, origin: QPointF | QPoint = None)¶
Refreshes an item’s rotation by rechecking it against any possible overrides such as data defined rotation.
The optional
origin
point specifies the origin (in item coordinates) around which the rotation should be applied.See also
See also
- refreshItemSize(self)¶
Refreshes an item’s size by rechecking it against any possible item fixed or minimum sizes.
See also
See also
See also
- refreshOpacity(self, updateItem: bool = True)¶
Refresh item’s opacity, considering data defined opacity. If
updateItem
is set toFalse
the item will not be automatically updated after the opacity is set and a later call toupdate()
must be made.
- sceneEvent(self, QEvent) bool ¶
- sceneEventFilter(self, QGraphicsItem, QEvent) bool ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setAtlasDriven(self, enabled: bool)¶
Sets whether the profile curve will follow the current atlas feature.
This requires an active layout atlas or report, using a line geometry type coverage layer.
See also
- Parameters:
enabled (bool) –
- setCrs(self, crs: QgsCoordinateReferenceSystem)¶
Sets the desired Coordinate Reference System (
crs
) for the profile.This also represents the CRS associated with the
profileCurve()
.See also
- Parameters:
crs (QgsCoordinateReferenceSystem) –
- setDistanceUnit(self, unit: Qgis.DistanceUnit)¶
Sets the
unit
for the distance axis.See also
New in version 3.32.
- Parameters:
unit (Qgis.DistanceUnit) –
- setFixedSize(self, size: QgsLayoutSize)¶
Sets a fixed
size
for the layout item, which prevents it from being freely resized. Set an empty size if item can be freely resized.See also
fixedSize()
See also
- setLayers(self, layers: Iterable[QgsMapLayer])¶
Sets the list of map
layers
participating in the elevation profile.See also
- Parameters:
layers (Iterable[QgsMapLayer]) –
- setMinimumSize(self, size: QgsLayoutSize)¶
Sets the minimum allowed
size
for the layout item. Set an empty size if item can be freely resized.See also
minimumSize()
See also
- setProfileCurve(self, curve: QgsCurve)¶
Sets the cross section profile
curve
, which represents the line along which the profile should be generated.Ownership of
curve
is transferred to the item.The coordinate reference system of the
curve
is set viasetCrs()
.See also
- Parameters:
curve (QgsCurve) –
- setTolerance(self, tolerance: float)¶
Sets the tolerance of the request (in
crs()
units).This value determines how far from the
profileCurve()
is appropriate for inclusion of results. For instance, when a profile is generated for a point vector layer this tolerance distance will dictate how far from the actual profile curve a point can reside within to be included in the results. Other sources may completely ignore this tolerance if it is not appropriate for the particular source.See also
- Parameters:
tolerance (float) –
- timerEvent(self, QTimerEvent)¶
- tolerance(self) float ¶
Returns the tolerance of the request (in
crs()
units).This value determines how far from the
profileCurve()
is appropriate for inclusion of results. For instance, when a profile is generated for a point vector layer this tolerance distance will dictate how far from the actual profile curve a point can reside within to be included in the results. Other sources may completely ignore this tolerance if it is not appropriate for the particular source.See also
- Return type:
float
- topLeftToReferencePoint(self, point: QgsLayoutPoint) QgsLayoutPoint ¶
Returns the position for the reference point of the item, if the top-left of the item was placed at the specified
point
.
- type(self) int ¶
- Return type:
int
- updateMicroFocus(self)¶
- wheelEvent(self, QGraphicsSceneWheelEvent)¶
- 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
- writePropertiesToElement(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool ¶
- Parameters:
element (QDomElement) –
document (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
bool