use const abstract geom in virtual handlers

This commit is contained in:
Denis Rouzaud 2022-01-07 10:08:43 +01:00
parent 04d79bef6c
commit f577cf9ed2
4 changed files with 8 additions and 8 deletions

View File

@ -346,14 +346,14 @@ geometryCaptured is called just before
.. versionadded:: 3.24 .. versionadded:: 3.24
%End %End
virtual void lineCaptured( QgsCurve *line ); virtual void lineCaptured( const QgsCurve *line );
%Docstring %Docstring
Called when a line is captured Called when a line is captured
geometryCaptured is called just before geometryCaptured is called just before
.. versionadded:: 3.24 .. versionadded:: 3.24
%End %End
virtual void polygonCaptured( QgsCurvePolygon *polygon ); virtual void polygonCaptured( const QgsCurvePolygon *polygon );
%Docstring %Docstring
Called when a polygon is captured Called when a polygon is captured
geometryCaptured is called just before geometryCaptured is called just before

View File

@ -86,7 +86,7 @@ void QgsMapToolAddPart::pointCaptured( const QgsPoint &point )
finalizeEditCommand( layer, errorCode ); finalizeEditCommand( layer, errorCode );
} }
void QgsMapToolAddPart::lineCaptured( QgsCurve *line ) void QgsMapToolAddPart::lineCaptured( const QgsCurve *line )
{ {
QgsVectorLayer *layer = getLayerAndCheckSelection(); QgsVectorLayer *layer = getLayerAndCheckSelection();
if ( !layer ) if ( !layer )
@ -96,7 +96,7 @@ void QgsMapToolAddPart::lineCaptured( QgsCurve *line )
finalizeEditCommand( layer, errorCode ); finalizeEditCommand( layer, errorCode );
} }
void QgsMapToolAddPart::polygonCaptured( QgsCurvePolygon *polygon ) void QgsMapToolAddPart::polygonCaptured( const QgsCurvePolygon *polygon )
{ {
QgsVectorLayer *layer = getLayerAndCheckSelection(); QgsVectorLayer *layer = getLayerAndCheckSelection();
if ( !layer ) if ( !layer )

View File

@ -42,8 +42,8 @@ class APP_EXPORT QgsMapToolAddPart : public QgsMapToolCapture
QgsVectorLayer *getLayerAndCheckSelection(); QgsVectorLayer *getLayerAndCheckSelection();
void pointCaptured( const QgsPoint &point ) override; void pointCaptured( const QgsPoint &point ) override;
void lineCaptured( QgsCurve *line ) override; void lineCaptured( const QgsCurve *line ) override;
void polygonCaptured( QgsCurvePolygon *polygon ) override; void polygonCaptured( const QgsCurvePolygon *polygon ) override;
void finalizeEditCommand( QgsVectorLayer *layer, Qgis::GeometryOperationResult errorCode ); void finalizeEditCommand( QgsVectorLayer *layer, Qgis::GeometryOperationResult errorCode );
}; };

View File

@ -357,14 +357,14 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
* geometryCaptured is called just before * geometryCaptured is called just before
* \since QGIS 3.24 * \since QGIS 3.24
*/ */
virtual void lineCaptured( QgsCurve *line ) {Q_UNUSED( line )} SIP_FORCE virtual void lineCaptured( const QgsCurve *line ) {Q_UNUSED( line )} SIP_FORCE
/** /**
* Called when a polygon is captured * Called when a polygon is captured
* geometryCaptured is called just before * geometryCaptured is called just before
* \since QGIS 3.24 * \since QGIS 3.24
*/ */
virtual void polygonCaptured( QgsCurvePolygon *polygon ) {Q_UNUSED( polygon )} SIP_FORCE virtual void polygonCaptured( const QgsCurvePolygon *polygon ) {Q_UNUSED( polygon )} SIP_FORCE
//! whether tracing has been requested by the user //! whether tracing has been requested by the user
bool tracingEnabled(); bool tracingEnabled();