mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Offset curve: add empty field values to newly created features
This commit is contained in:
parent
c7c840fb87
commit
df25981fed
@ -101,6 +101,16 @@ void QgsMapToolOffsetCurve::canvasReleaseEvent( QMouseEvent * e )
|
||||
{
|
||||
QgsFeature f;
|
||||
f.setGeometry( mModifiedGeometry );
|
||||
|
||||
//add empty values for all fields (allows to insert attribute values via the feature form in the same session)
|
||||
QgsAttributeMap attMap;
|
||||
const QgsFieldMap& fields = vlayer->pendingFields();
|
||||
QgsFieldMap::const_iterator fieldIt = fields.constBegin();
|
||||
for ( ; fieldIt != fields.constEnd(); ++fieldIt )
|
||||
{
|
||||
attMap.insert( fieldIt.key(), QVariant() );
|
||||
}
|
||||
f.setAttributeMap( attMap );
|
||||
editOk = vlayer->addFeature( f );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user