Skip to content

Commit 1182816

Browse files
committedFeb 24, 2017
Add new constructor QgsPoint( const QgsPointV2& )
1 parent 520e3c0 commit 1182816

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
 

‎src/core/qgspoint.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818

1919
#include "qgspoint.h"
20+
#include "qgspointv2.h"
2021

2122
#include <cmath>
2223
#include <QTextStream>
@@ -30,6 +31,12 @@ QgsPoint::QgsPoint( const QgsPoint& p )
3031
mY = p.y();
3132
}
3233

34+
QgsPoint::QgsPoint( const QgsPointV2& point )
35+
: mX( point.x() )
36+
, mY( point.y() )
37+
{
38+
}
39+
3340
QPointF QgsPoint::toQPointF() const
3441
{
3542
return QPointF( mX, mY );

‎src/core/qgspoint.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include <QPoint>
2828
#include <QObject>
2929

30+
class QgsPointV2;
31+
3032
/** \ingroup core
3133
* A class to represent a point.
3234
* For Z and M support prefer QgsPointV2.
@@ -75,6 +77,14 @@ class CORE_EXPORT QgsPoint
7577
, mY( point.y() )
7678
{}
7779

80+
/**
81+
* Create a new point.
82+
* Z and M values will be dropped.
83+
*
84+
* @note Added in QGIS 3.0
85+
*/
86+
QgsPoint( const QgsPointV2& point );
87+
7888
~QgsPoint()
7989
{}
8090

0 commit comments

Comments
 (0)
Please sign in to comment.