Skip to content
Permalink
Browse files

Add new constructor QgsPoint( const QgsPointV2& )

  • Loading branch information
m-kuhn committed Feb 24, 2017
1 parent 520e3c0 commit 1182816956fcf4efea5bd1b16b04ad2e16e4b6d5
Showing with 17 additions and 0 deletions.
  1. +7 −0 src/core/qgspoint.cpp
  2. +10 −0 src/core/qgspoint.h
@@ -17,6 +17,7 @@


#include "qgspoint.h"
#include "qgspointv2.h"

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

QgsPoint::QgsPoint( const QgsPointV2& point )
: mX( point.x() )
, mY( point.y() )
{
}

QPointF QgsPoint::toQPointF() const
{
return QPointF( mX, mY );
@@ -27,6 +27,8 @@
#include <QPoint>
#include <QObject>

class QgsPointV2;

/** \ingroup core
* A class to represent a point.
* For Z and M support prefer QgsPointV2.
@@ -75,6 +77,14 @@ class CORE_EXPORT QgsPoint
, mY( point.y() )
{}

/**
* Create a new point.
* Z and M values will be dropped.
*
* @note Added in QGIS 3.0
*/
QgsPoint( const QgsPointV2& point );

~QgsPoint()
{}

0 comments on commit 1182816

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