@@ -65,6 +65,8 @@ void QgsDualView::init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QgsDista
65
65
connect ( layer, SIGNAL ( editingStarted () ), this , SLOT ( editingToggled () ) );
66
66
connect ( layer, SIGNAL ( beforeCommitChanges () ), this , SLOT ( editingToggled () ) );
67
67
connect ( layer, SIGNAL ( editingStopped () ), this , SLOT ( editingToggled () ) );
68
+ connect ( layer, SIGNAL ( attributeAdded ( int ) ), this , SLOT ( editingToggled () ) );
69
+ connect ( layer, SIGNAL ( attributeDeleted ( int ) ), this , SLOT ( editingToggled () ) );
68
70
69
71
initLayerCache ( layer );
70
72
initModels ( mapCanvas );
@@ -235,7 +237,7 @@ void QgsDualView::initModels( QgsMapCanvas* mapCanvas )
235
237
mFeatureListModel = new QgsFeatureListModel ( mFilterModel , mFilterModel );
236
238
}
237
239
238
- void QgsDualView::on_mFeatureList_currentEditSelectionChanged ( const QgsFeature &feat )
240
+ void QgsDualView::on_mFeatureList_currentEditSelectionChanged ( QgsFeature &feat )
239
241
{
240
242
if ( !feat.isValid () )
241
243
return ;
@@ -249,6 +251,9 @@ void QgsDualView::on_mFeatureList_currentEditSelectionChanged( const QgsFeature
249
251
mAttributeEditorLayout ->removeWidget ( mAttributeDialog ->dialog () );
250
252
}
251
253
254
+ if ( feat.attributes ().count () != mLayerCache ->layer ()->pendingFields ().count () )
255
+ mLayerCache ->featureAtId ( feat.id (), feat );
256
+
252
257
mAttributeDialog = new QgsAttributeDialog ( mLayerCache ->layer (), new QgsFeature ( feat ), true , mDistanceArea , this , false );
253
258
mAttributeEditorLayout ->addWidget ( mAttributeDialog ->dialog () );
254
259
mAttributeDialog ->dialog ()->setVisible ( true );
0 commit comments