Esempio n. 1
0
void QgsAttributeTableModel::attributeDeleted( int idx )
{
  if ( idx == mCachedField )
  {
    prefetchColumnData( -1 );
  }
}
Esempio n. 2
0
void QgsAttributeTableModel::featureDeleted( QgsFeatureId fid )
{
  prefetchColumnData( -1 ); // Invalidate cached column data

  int row = idToRow( fid );

  beginRemoveRows( QModelIndex(), row, row );
  removeRow( row );
  endRemoveRows();
}
Esempio n. 3
0
void QgsAttributeTableModel::featureAdded( QgsFeatureId fid, bool newOperation )
{
  prefetchColumnData( -1 ); // Invalidate cached column data
  int n = mRowIdMap.size();
  if ( newOperation )
    beginInsertRows( QModelIndex(), n, n );

  mIdRowMap.insert( fid, n );
  mRowIdMap.insert( n, fid );

  if ( newOperation )
    endInsertRows();

  reload( index( rowCount() - 1, 0 ), index( rowCount() - 1, columnCount() ) );
}