File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ QgsVectorLayer* RgExportDlg::mapLayer() const
83
83
return NULL ;
84
84
85
85
QList<QgsField> attrList;
86
- attrList.append ( QgsField ( " one " , QVariant::Int ) );
86
+ attrList.append ( QgsField ( " id " , QVariant::Int ) );
87
87
prov->addAttributes ( attrList );
88
88
QList<QgsMapLayer *> myList;
89
89
myList << myLayer;
Original file line number Diff line number Diff line change 37
37
#include < qgsfeature.h>
38
38
#include < qgsapplication.h>
39
39
#include < qgsvectorlayer.h>
40
+ #include < qgsvectordataprovider.h>
40
41
#include < qgsmessagebar.h>
41
42
42
43
#include < qgsgraphdirector.h>
@@ -400,10 +401,11 @@ void RgShortestPathWidget::exportPath()
400
401
}
401
402
p.push_front ( ct.transform ( p1 ) );
402
403
403
- vl->startEditing ();
404
404
QgsFeature f;
405
+ QgsFeatureList features;
405
406
f.setGeometry ( QgsGeometry::fromPolyline ( p ) );
406
- vl->addFeature ( f );
407
+ features << f;
408
+ vl->dataProvider ()->addFeatures ( features );
407
409
vl->updateExtents ();
408
410
409
411
mPlugin ->iface ()->mapCanvas ()->update ();
You can’t perform that action at this time.
0 commit comments