Class: QgsElevationProfileCanvas¶
- class qgis.gui.QgsElevationProfileCanvas¶
Bases:
QgsPlotCanvas
A canvas for elevation profiles.
New in version 3.26.
QgsElevationProfileCanvas(parent: QWidget = None) Constructor for
QgsElevationProfileCanvas
, with the specifiedparent
widget.Methods
Converts a canvas point to the equivalent plot point.
- param x:
Clears the current profile.
- rtype:
QgsCoordinateReferenceSystem
Identify results visible at the specified plot point.
Invalidates the current plot extent, which means that the visible plot area will be recalculated and "zoom full" operation occur when the next profile generation completes.
Returns the list of layers included in the profile.
- param e:
- param event:
- param dx:
Returns the interior rectangle representing the surface of the plot, in canvas coordinates.
Converts a plot point to the equivalent canvas point.
Returns the profile curve.
Triggers a complete regeneration of the profile, causing the profile extraction to perform in the background.
Renders a portion of the profile using the specified render
context
.- param event:
scalePlot(self, xFactor: float, yFactor: float) Scales the plot axis by the given factors.
scrollContentsBy
Sets the
crs
associated with the canvas' map coordinates.Sets the list of
layers
to include in the profile.Sets the profile
curve
.Sets the
project
associated with the profile.Sets whether snapping of cursor points is enabled.
Sets the profile tolerance (in
crs()
units).Sets the visible area of the plot.
- param point:
- param point:
- param point:
Returns the tolerance of the profile (in
crs()
units).Returns the distance range currently visible in the plot.
Returns the elevation range currently visible in the plot.
- param event:
Zooms to the full extent of the profile.
- param rect:
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- actionEvent(self, QActionEvent)¶
- activeJobCountChanged¶
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
- canvasPointHovered¶
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
- canvasPointToPlotPoint(self, point: QPointF | QPoint) QgsProfilePoint ¶
Converts a canvas point to the equivalent plot point.
See also
- Parameters:
point (Union[QPointF) –
- Return type:
- centerPlotOn(self, x: float, y: float)¶
- Parameters:
x (float) –
y (float) –
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- clear(self)¶
Clears the current profile.
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- crs(self) QgsCoordinateReferenceSystem ¶
- Return type:
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- drawBackground(self, QPainter, QRectF)¶
- drawForeground(self, QPainter, QRectF)¶
- drawFrame(self, QPainter)¶
- dropEvent(self, QDropEvent)¶
- enterEvent(self, QEvent)¶
- event(self, e: QEvent) bool ¶
- eventFilter(self, QObject, QEvent) bool ¶
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, QHideEvent)¶
- identify(self, point: QPointF | QPoint) List[QgsProfileIdentifyResults] ¶
Identify results visible at the specified plot point.
identify(self, rect: QRectF) -> List[QgsProfileIdentifyResults] Identify results visible within the specified plot rect.
- Parameters:
point (Union[QPointF) –
- Return type:
- initPainter(self, QPainter)¶
- initStyleOption(self, QStyleOptionFrame)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- invalidateCurrentPlotExtent(self)¶
Invalidates the current plot extent, which means that the visible plot area will be recalculated and “zoom full” operation occur when the next profile generation completes.
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, e: QKeyEvent)¶
- keyReleaseEvent(self, e: QKeyEvent)¶
- layers(self) List[QgsMapLayer] ¶
Returns the list of layers included in the profile.
See also
- Return type:
List[QgsMapLayer]
- leaveEvent(self, QEvent)¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, e: QMouseEvent)¶
- mouseMoveEvent(self, e: QMouseEvent)¶
- Parameters:
e (QMouseEvent) –
- mousePressEvent(self, e: QMouseEvent)¶
- mouseReleaseEvent(self, e: QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, event: QPaintEvent)¶
- Parameters:
event (QPaintEvent) –
- panContentsBy(self, dx: float, dy: float)¶
- Parameters:
dx (float) –
dy (float) –
- plotArea(self) QRectF ¶
Returns the interior rectangle representing the surface of the plot, in canvas coordinates.
- Return type:
QRectF
- plotPointToCanvasPoint(self, point: QgsProfilePoint) QgsPointXY ¶
Converts a plot point to the equivalent canvas point.
See also
- Parameters:
point (QgsProfilePoint) –
- Return type:
- profileCurve(self) QgsCurve ¶
Returns the profile curve.
The CRS associated with the curve is retrieved via
crs()
.See also
- Return type:
- receivers(self, PYQT_SIGNAL) int ¶
- refresh(self)¶
Triggers a complete regeneration of the profile, causing the profile extraction to perform in the background.
- render(self, context: QgsRenderContext, width: float, height: float, plotSettings: Qgs2DPlot)¶
Renders a portion of the profile using the specified render
context
.- Parameters:
context (QgsRenderContext) –
width (float) –
height (float) –
plotSettings (Qgs2DPlot) –
- resizeEvent(self, event: QResizeEvent)¶
- Parameters:
event (QResizeEvent) –
- scalePlot(self, factor: float)¶
scalePlot(self, xFactor: float, yFactor: float) Scales the plot axis by the given factors.
- Parameters:
factor (float) –
- QgsElevationProfileCanvas.scrollContentsBy(self, int, int)
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setCrs(self, crs: QgsCoordinateReferenceSystem)¶
Sets the
crs
associated with the canvas’ map coordinates.See also
- Parameters:
crs (QgsCoordinateReferenceSystem) –
- setLayers(self, layers: Iterable[QgsMapLayer])¶
Sets the list of
layers
to include in the profile.See also
- Parameters:
layers (Iterable[QgsMapLayer]) –
- setProfileCurve(self, curve: QgsCurve)¶
Sets the profile
curve
.The CRS associated with
curve
is set viasetCrs()
.Ownership is transferred to the plot canvas.
See also
- Parameters:
curve (QgsCurve) –
- setProject(self, project: QgsProject)¶
Sets the
project
associated with the profile.This must be set before any layers which utilize terrain based elevation settings can be included in the canvas.
- Parameters:
project (QgsProject) –
- setSnappingEnabled(self, enabled: bool)¶
Sets whether snapping of cursor points is enabled.
- Parameters:
enabled (bool) –
- setTolerance(self, tolerance: float)¶
Sets the profile tolerance (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.See also
- Parameters:
tolerance (float) –
- QgsElevationProfileCanvas.setViewportMargins(self, int, int, int, int)
- setViewportMargins(self, QMargins) None ¶
- setVisiblePlotRange(self, minimumDistance: float, maximumDistance: float, minimumElevation: float, maximumElevation: float)¶
Sets the visible area of the plot.
See also
See also
- Parameters:
minimumDistance (float) –
maximumDistance (float) –
minimumElevation (float) –
maximumElevation (float) –
- setupViewport(self, QWidget)¶
- showEvent(self, QShowEvent)¶
- snapToPlot(self, point: QPoint) QgsPointXY ¶
- Parameters:
point (QPoint) –
- Return type:
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- toCanvasCoordinates(self, point: QgsPoint) QgsPointXY ¶
- Parameters:
point (QgsPoint) –
- Return type:
- toMapCoordinates(self, point: QgsPointXY) QgsPoint ¶
- Parameters:
point (QgsPointXY) –
- Return type:
- tolerance(self) float ¶
Returns the tolerance of the profile (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.See also
- Return type:
float
- updateMicroFocus(self)¶
- viewportEvent(self, event: QEvent) bool ¶
- viewportMargins(self) QMargins ¶
- viewportSizeHint(self) QSize ¶
- visibleDistanceRange(self) QgsDoubleRange ¶
Returns the distance range currently visible in the plot.
See also
See also
- Return type:
- visibleElevationRange(self) QgsDoubleRange ¶
Returns the elevation range currently visible in the plot.
See also
See also
- Return type:
- wheelEvent(self, e: QWheelEvent)¶
- wheelZoom(self, event: QWheelEvent)¶
- Parameters:
event (QWheelEvent) –
- zoomFull(self)¶
Zooms to the full extent of the profile.
- zoomToRect(self, rect: QRectF)¶
- Parameters:
rect (QRectF) –