File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ class QgsFeature
90
90
//! Constructor
91
91
QgsFeature( qint64 id = 0 );
92
92
93
+ QgsFeature( const QgsFields& fields, qint64 id = 0 );
94
+
93
95
/** copy ctor needed due to internal pointer */
94
96
QgsFeature( const QgsFeature & rhs );
95
97
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ QgsFeature::QgsFeature( QgsFeatureId id )
37
37
// NOOP
38
38
}
39
39
40
+ QgsFeature::QgsFeature ( const QgsFields &fields, QgsFeatureId id )
41
+ : mFid( id )
42
+ , mGeometry( 0 )
43
+ , mOwnsGeometry( 0 )
44
+ , mValid( false )
45
+ , mFields( &fields )
46
+ {
47
+ initAttributes ( fields.count () );
48
+ }
49
+
40
50
QgsFeature::QgsFeature ( QgsFeature const & rhs )
41
51
: mFid( rhs.mFid )
42
52
, mAttributes( rhs.mAttributes )
Original file line number Diff line number Diff line change @@ -117,6 +117,8 @@ class CORE_EXPORT QgsFeature
117
117
// ! Constructor
118
118
QgsFeature ( QgsFeatureId id = QgsFeatureId() );
119
119
120
+ QgsFeature ( const QgsFields& fields, QgsFeatureId id = QgsFeatureId() );
121
+
120
122
/* * copy ctor needed due to internal pointer */
121
123
QgsFeature ( const QgsFeature & rhs );
122
124
You can’t perform that action at this time.
0 commit comments