@@ -264,6 +264,8 @@ void QgsAttributeTableDialog::columnBoxInit()
264
264
QgsFieldMap fieldMap = mLayer ->pendingFields ();
265
265
QgsFieldMap::Iterator it = fieldMap.begin ();
266
266
267
+ mColumnBox ->clear ();
268
+
267
269
for ( ; it != fieldMap.end (); ++it )
268
270
if ( mLayer ->editType ( it.key () ) != QgsVectorLayer::Hidden )
269
271
mColumnBox ->addItem ( it.value ().name () );
@@ -705,7 +707,8 @@ void QgsAttributeTableDialog::on_mAddAttribute_clicked()
705
707
mLayer ->destroyEditCommand ();
706
708
}
707
709
// update model - a field has been added or updated
708
- mModel ->reload ( mModel ->index ( 0 , 0 ), mModel ->index ( mModel ->rowCount () - 1 , mModel ->columnCount () - 1 ) );
710
+ mModel ->reload ( mModel ->index ( 0 , 0 ), mModel ->index ( mModel ->rowCount () - 1 , mModel ->columnCount () - 1 ) );\
711
+ columnBoxInit ();
709
712
}
710
713
}
711
714
@@ -747,6 +750,7 @@ void QgsAttributeTableDialog::on_mRemoveAttribute_clicked()
747
750
}
748
751
// update model - a field has been added or updated
749
752
mModel ->reload ( mModel ->index ( 0 , 0 ), mModel ->index ( mModel ->rowCount () - 1 , mModel ->columnCount () - 1 ) );
753
+ columnBoxInit ();
750
754
}
751
755
}
752
756
@@ -760,6 +764,7 @@ void QgsAttributeTableDialog::on_mOpenFieldCalculator_clicked()
760
764
if ( col >= 0 )
761
765
{
762
766
mModel ->reload ( mModel ->index ( 0 , col ), mModel ->index ( mModel ->rowCount () - 1 , col ) );
767
+ columnBoxInit ();
763
768
}
764
769
}
765
770
}
0 commit comments