Skip to content
Permalink
Browse files

match Qt naming schema for factories

  • Loading branch information
PeterPetrik committed Jun 28, 2018
1 parent 7bfcaf4 commit b55db3dfb5438b861a788de11f1fb343ded85eb8
Showing with 6 additions and 6 deletions.
  1. +2 −2 src/quickgui/qgsquickutils.cpp
  2. +2 −2 src/quickgui/qgsquickutils.h
  3. +2 −2 tests/src/quickgui/testqgsquickutils.cpp
@@ -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 );
}
@@ -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
@@ -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 );

0 comments on commit b55db3d

Please sign in to comment.
You can’t perform that action at this time.