Skip to content

Commit

Permalink
match Qt naming schema for factories
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Jun 28, 2018
1 parent 7bfcaf4 commit b55db3d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/quickgui/qgsquickutils.cpp
Expand Up @@ -42,12 +42,12 @@ QgsCoordinateReferenceSystem QgsQuickUtils::coordinateReferenceSystemFromEpsgId(
return QgsCoordinateReferenceSystem::fromEpsgId( epsg );
}

QgsPointXY QgsQuickUtils::pointXYFactory( double x, double y ) const
QgsPointXY QgsQuickUtils::pointXY( double x, double y ) const
{
return QgsPointXY( x, y );
}

QgsPoint QgsQuickUtils::pointFactory( double x, double y, double z, double m ) const
QgsPoint QgsQuickUtils::point( double x, double y, double z, double m ) const
{
return QgsPoint( x, y, z, m );
}
Expand Down
4 changes: 2 additions & 2 deletions src/quickgui/qgsquickutils.h
Expand Up @@ -84,14 +84,14 @@ class QUICK_EXPORT QgsQuickUtils: public QObject
*
* \since QGIS 3.4
*/
Q_INVOKABLE QgsPointXY pointXYFactory( double x, double y ) const;
Q_INVOKABLE QgsPointXY pointXY( double x, double y ) const;

/**
* Creates QgsPoint in QML
*
* \since QGIS 3.4
*/
Q_INVOKABLE QgsPoint pointFactory( double x, double y, double z = std::numeric_limits<double>::quiet_NaN(), double m = std::numeric_limits<double>::quiet_NaN() ) const;
Q_INVOKABLE QgsPoint point( double x, double y, double z = std::numeric_limits<double>::quiet_NaN(), double m = std::numeric_limits<double>::quiet_NaN() ) const;

/**
* Converts QGeoCoordinate to QgsPoint
Expand Down
4 changes: 2 additions & 2 deletions tests/src/quickgui/testqgsquickutils.cpp
Expand Up @@ -72,11 +72,11 @@ void TestQgsQuickUtils::screenUnitsToMeters()

void TestQgsQuickUtils::transformedPoint()
{
QgsPointXY pointXY = utils.pointXYFactory( 49.9, 16.3 );
QgsPointXY pointXY = utils.pointXY( 49.9, 16.3 );
QGSCOMPARENEAR( pointXY.x(), 49.9, 1e-4 );
QGSCOMPARENEAR( pointXY.y(), 16.3, 1e-4 );

QgsPoint point = utils.pointFactory( 1.0, -1.0 );
QgsPoint point = utils.point( 1.0, -1.0 );
QGSCOMPARENEAR( point.x(), 1.0, 1e-4 );
QGSCOMPARENEAR( point.y(), -1.0, 1e-4 );

Expand Down

0 comments on commit b55db3d

Please sign in to comment.