Skip to content
Permalink
Browse files

[FIX #7530] Attribute table: Edited feature not updated in single row

If only a single row was shown, the outdated cached feature would be shown even
when the attribute behind it was edited.
  • Loading branch information
m-kuhn committed Apr 8, 2013
1 parent 663e95d commit 9c9dd2b4cdb38ad9bd7293a7ec481386e8122960
@@ -188,6 +188,10 @@ void QgsAttributeTableModel::layerDeleted()

void QgsAttributeTableModel::attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value )
{
if ( fid == mFeat.id() )
{
mFeat.setValid( false );
}
setData( index( idToRow( fid ), fieldCol( idx ) ), value, Qt::EditRole );
}

@@ -469,7 +473,7 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons
}

// if we don't have the row in current cache, load it from layer first
if ( mFeat.id() != rowId )
if ( mFeat.id() != rowId || !mFeat.isValid() )
{
if ( !loadFeatureAtId( rowId ) )
return QVariant( "ERROR" );
@@ -79,9 +79,6 @@ bool QgsAttributeTableView::eventFilter(QObject *object, QEvent *event)
{
if ( object == verticalHeader()->viewport() )
{

qDebug() << "Event " << event->type();

switch ( event->type() )
{
case QEvent::MouseButtonPress:

0 comments on commit 9c9dd2b

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