Skip to content

Commit

Permalink
Add method to retrieve QgsVertexMarker center point in map coordinates
Browse files Browse the repository at this point in the history
(cherry picked from commit 0d785c8)
  • Loading branch information
nyalldawson committed Jan 15, 2021
1 parent cedebdf commit 9077606
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions python/gui/auto_generated/qgsvertexmarker.sip.in
Expand Up @@ -46,6 +46,20 @@ A class for marking vertices of features using e.g. circles or 'x'.
QgsVertexMarker( QgsMapCanvas *mapCanvas /TransferThis/ );

void setCenter( const QgsPointXY &point );
%Docstring
Sets the center ``point`` of the marker, in map coordinates.

.. seealso:: :py:func:`center`
%End

QgsPointXY center() const;
%Docstring
Returns the center point of the marker, in map coordinates.

.. seealso:: :py:func:`setCenter`

.. versionadded:: 3.18
%End

void setIconType( int iconType );

Expand Down
13 changes: 13 additions & 0 deletions src/gui/qgsvertexmarker.h
Expand Up @@ -61,8 +61,21 @@ class GUI_EXPORT QgsVertexMarker : public QgsMapCanvasItem

QgsVertexMarker( QgsMapCanvas *mapCanvas SIP_TRANSFERTHIS );

/**
* Sets the center \a point of the marker, in map coordinates.
*
* \see center()
*/
void setCenter( const QgsPointXY &point );

/**
* Returns the center point of the marker, in map coordinates.
*
* \see setCenter()
* \since QGIS 3.18
*/
QgsPointXY center() const { return mCenter; }

void setIconType( int iconType );

void setIconSize( int iconSize );
Expand Down

0 comments on commit 9077606

Please sign in to comment.