diff --git a/src/gui/attributetable/qgsattributetablemodel.cpp b/src/gui/attributetable/qgsattributetablemodel.cpp index 743a28a35673..caac90f7671d 100644 --- a/src/gui/attributetable/qgsattributetablemodel.cpp +++ b/src/gui/attributetable/qgsattributetablemodel.cpp @@ -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" ); diff --git a/src/gui/attributetable/qgsattributetableview.cpp b/src/gui/attributetable/qgsattributetableview.cpp index d6ddbdf95814..c8fa1ed24d33 100644 --- a/src/gui/attributetable/qgsattributetableview.cpp +++ b/src/gui/attributetable/qgsattributetableview.cpp @@ -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: