Skip to content

Commit

Permalink
Improve documentation of QgsMapTool class members
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanuhrig authored and nyalldawson committed Jan 28, 2021
1 parent 1eb68b8 commit ca98f88
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
18 changes: 9 additions & 9 deletions python/gui/auto_generated/qgsmaptool.sip.in
Expand Up @@ -263,46 +263,46 @@ signal emitted once the map tool is deactivated

QgsMapTool( QgsMapCanvas *canvas /TransferThis/ );
%Docstring
constructor takes map canvas as a parameter
Constructor takes a map canvas as a parameter.
%End

QgsPointXY toMapCoordinates( QPoint point );
%Docstring
transformation from screen coordinates to map coordinates
Transforms a ``point`` from screen coordinates to map coordinates.
%End

QgsPointXY toLayerCoordinates( const QgsMapLayer *layer, QPoint point );
%Docstring
transformation from screen coordinates to layer's coordinates
Transforms a ``point`` from screen coordinates to ``layer`` coordinates.
%End

QgsPointXY toLayerCoordinates( const QgsMapLayer *layer, const QgsPointXY &point );
%Docstring
transformation from map coordinates to layer's coordinates
Transforms a ``point`` from map coordinates to ``layer`` coordinates.
%End

QgsPointXY toMapCoordinates( const QgsMapLayer *layer, const QgsPointXY &point );
%Docstring
transformation from layer's coordinates to map coordinates (which is different in case reprojection is used)
Transforms a ``point`` from ``layer`` coordinates to map coordinates (which is different in case reprojection is used).
%End

QgsPoint toMapCoordinates( const QgsMapLayer *layer, const QgsPoint &point ) /PyName=toMapCoordinatesV2/;
%Docstring
transformation from layer's coordinates to map coordinates (which is different in case reprojection is used)
Transforms a ``point`` from ``layer`` coordinates to map coordinates (which is different in case reprojection is used).

.. note::

available in Python bindings as toMapCoordinatesV2
This method is available in the Python bindings as toMapCoordinatesV2.
%End

QgsRectangle toLayerCoordinates( const QgsMapLayer *layer, const QgsRectangle &rect );
%Docstring
trnasformation of the rect from map coordinates to layer's coordinates
Transforms a ``rect`` from map coordinates to ``layer`` coordinates.
%End

QPoint toCanvasCoordinates( const QgsPointXY &point ) const;
%Docstring
transformation from map coordinates to screen coordinates
Transforms a ``point`` from map coordinates to screen coordinates.
%End


Expand Down
32 changes: 16 additions & 16 deletions src/gui/qgsmaptool.h
Expand Up @@ -257,52 +257,52 @@ class GUI_EXPORT QgsMapTool : public QObject

protected:

//! constructor takes map canvas as a parameter
//! Constructor takes a map canvas as a parameter.
QgsMapTool( QgsMapCanvas *canvas SIP_TRANSFERTHIS );

//! transformation from screen coordinates to map coordinates
//! Transforms a \a point from screen coordinates to map coordinates.
QgsPointXY toMapCoordinates( QPoint point );

//! transformation from screen coordinates to layer's coordinates
//! Transforms a \a point from screen coordinates to \a layer coordinates.
QgsPointXY toLayerCoordinates( const QgsMapLayer *layer, QPoint point );

//! transformation from map coordinates to layer's coordinates
//! Transforms a \a point from map coordinates to \a layer coordinates.
QgsPointXY toLayerCoordinates( const QgsMapLayer *layer, const QgsPointXY &point );

//!transformation from layer's coordinates to map coordinates (which is different in case reprojection is used)
//! Transforms a \a point from \a layer coordinates to map coordinates (which is different in case reprojection is used).
QgsPointXY toMapCoordinates( const QgsMapLayer *layer, const QgsPointXY &point );

/**
* transformation from layer's coordinates to map coordinates (which is different in case reprojection is used)
* \note available in Python bindings as toMapCoordinatesV2
* Transforms a \a point from \a layer coordinates to map coordinates (which is different in case reprojection is used).
* \note This method is available in the Python bindings as toMapCoordinatesV2.
*/
QgsPoint toMapCoordinates( const QgsMapLayer *layer, const QgsPoint &point ) SIP_PYNAME( toMapCoordinatesV2 );

//! trnasformation of the rect from map coordinates to layer's coordinates
//! Transforms a \a rect from map coordinates to \a layer coordinates.
QgsRectangle toLayerCoordinates( const QgsMapLayer *layer, const QgsRectangle &rect );

//! transformation from map coordinates to screen coordinates
//! Transforms a \a point from map coordinates to screen coordinates.
QPoint toCanvasCoordinates( const QgsPointXY &point ) const;

//! pointer to map canvas
//! The pointer to the map canvas
QgsMapCanvas *mCanvas = nullptr;

//! cursor used in map tool
//! The cursor used in the map tool
QCursor mCursor;

/**
* optionally map tool can have pointer to action
* which will be used to set that action as active
* Optional pointer to an action that will be checked on map tool activation
* and unchecked on map tool deactivation.
*/
QAction *mAction = nullptr;

/**
* optionally map tool can have pointer to a button
* which will be used to set that action as active
* Optional pointer to a button that will be checked on map tool activation
* and unchecked on map tool deactivation.
*/
QAbstractButton *mButton = nullptr;

//! translated name of the map tool
//! The translated name of the map tool
QString mToolName;

};
Expand Down

0 comments on commit ca98f88

Please sign in to comment.