Skip to content

Commit

Permalink
Make QgsCoordinateUtils functions Q_INVOKABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 16, 2018
1 parent 3e14761 commit 98781da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/CMakeLists.txt
Expand Up @@ -593,6 +593,7 @@ SET(QGIS_CORE_MOC_HDRS
qgsbrowsermodel.h
qgsbrowserproxymodel.h
qgscoordinatereferencesystem.h
qgscoordinateutils.h
qgscredentials.h
qgsdataitem.h
qgsdataprovider.h
Expand Down Expand Up @@ -840,7 +841,6 @@ SET(QGIS_CORE_HDRS
qgscoordinateformatter.h
qgscoordinatetransform.h
qgscoordinatetransformcontext.h
qgscoordinateutils.h
qgsdartmeasurement.h
qgsdatadefinedsizelegend.h
qgsdataitemprovider.h
Expand Down
7 changes: 5 additions & 2 deletions src/core/qgscoordinateutils.h
Expand Up @@ -21,6 +21,7 @@
#define SIP_NO_FILE

#include <QString>
#include <QObject>

#include "qgis_core.h"

Expand All @@ -39,6 +40,8 @@ class QgsProject;
*/
class CORE_EXPORT QgsCoordinateUtils
{
Q_GADGET

public:

/**
Expand All @@ -52,14 +55,14 @@ class CORE_EXPORT QgsCoordinateUtils
* \param mapCrs CRS of map
* \returns optimal number of decimal places for coordinates
*/
static int calculateCoordinatePrecision( double mapUnitsPerPixel, const QgsCoordinateReferenceSystem &mapCrs );
Q_INVOKABLE static int calculateCoordinatePrecision( double mapUnitsPerPixel, const QgsCoordinateReferenceSystem &mapCrs );

/**
* Formats a \a point coordinate for use with the specified \a project, respecting the project's
* coordinate display settings.
* \since QGIS 3.2
*/
static QString formatCoordinateForProject( QgsProject *project, const QgsPointXY &point, const QgsCoordinateReferenceSystem &destCrs, int precision );
Q_INVOKABLE static QString formatCoordinateForProject( QgsProject *project, const QgsPointXY &point, const QgsCoordinateReferenceSystem &destCrs, int precision );

};

Expand Down

0 comments on commit 98781da

Please sign in to comment.