Skip to content
Permalink
Browse files
Add overload for QgsFeature with QgsFields
  • Loading branch information
NathanW2 committed Mar 30, 2013
1 parent bd373fd commit fe59da52dace75ec994943ca5600fe99cdbf407c
Showing with 14 additions and 0 deletions.
  1. +2 −0 python/core/qgsfeature.sip
  2. +10 −0 src/core/qgsfeature.cpp
  3. +2 −0 src/core/qgsfeature.h
@@ -90,6 +90,8 @@ class QgsFeature
//! Constructor
QgsFeature( qint64 id = 0 );

QgsFeature( const QgsFields& fields, qint64 id = 0 );

/** copy ctor needed due to internal pointer */
QgsFeature( const QgsFeature & rhs );

@@ -37,6 +37,16 @@ QgsFeature::QgsFeature( QgsFeatureId id )
// NOOP
}

QgsFeature::QgsFeature( const QgsFields &fields, QgsFeatureId id )
: mFid( id )
, mGeometry( 0 )
, mOwnsGeometry( 0 )
, mValid( false )
, mFields( &fields )
{
initAttributes( fields.count() );
}

QgsFeature::QgsFeature( QgsFeature const & rhs )
: mFid( rhs.mFid )
, mAttributes( rhs.mAttributes )
@@ -117,6 +117,8 @@ class CORE_EXPORT QgsFeature
//! Constructor
QgsFeature( QgsFeatureId id = QgsFeatureId() );

QgsFeature( const QgsFields& fields, QgsFeatureId id = QgsFeatureId() );

/** copy ctor needed due to internal pointer */
QgsFeature( const QgsFeature & rhs );

0 comments on commit fe59da5

Please sign in to comment.