Skip to content
Permalink
Browse files

update columns list when attribute table updated

  • Loading branch information
alexbruy committed Aug 18, 2012
1 parent 1e2838f commit a38ce7369eb2cd69c3de706130d9d89bd8519d65
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/app/qgsattributetabledialog.cpp
@@ -264,6 +264,8 @@ void QgsAttributeTableDialog::columnBoxInit()
QgsFieldMap fieldMap = mLayer->pendingFields();
QgsFieldMap::Iterator it = fieldMap.begin();

mColumnBox->clear();

for ( ; it != fieldMap.end(); ++it )
if ( mLayer->editType( it.key() ) != QgsVectorLayer::Hidden )
mColumnBox->addItem( it.value().name() );
@@ -705,7 +707,8 @@ void QgsAttributeTableDialog::on_mAddAttribute_clicked()
mLayer->destroyEditCommand();
}
// update model - a field has been added or updated
mModel->reload( mModel->index( 0, 0 ), mModel->index( mModel->rowCount() - 1, mModel->columnCount() - 1 ) );
mModel->reload( mModel->index( 0, 0 ), mModel->index( mModel->rowCount() - 1, mModel->columnCount() - 1 ) );\
columnBoxInit();
}
}

@@ -747,6 +750,7 @@ void QgsAttributeTableDialog::on_mRemoveAttribute_clicked()
}
// update model - a field has been added or updated
mModel->reload( mModel->index( 0, 0 ), mModel->index( mModel->rowCount() - 1, mModel->columnCount() - 1 ) );
columnBoxInit();
}
}

@@ -760,6 +764,7 @@ void QgsAttributeTableDialog::on_mOpenFieldCalculator_clicked()
if ( col >= 0 )
{
mModel->reload( mModel->index( 0, col ), mModel->index( mModel->rowCount() - 1, col ) );
columnBoxInit();
}
}
}

0 comments on commit a38ce73

Please sign in to comment.
You can’t perform that action at this time.