Skip to content

Commit 9c9dd2b

Browse files
committed
[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.
1 parent 663e95d commit 9c9dd2b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/gui/attributetable/qgsattributetablemodel.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ void QgsAttributeTableModel::layerDeleted()
188188

189189
void QgsAttributeTableModel::attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value )
190190
{
191+
if ( fid == mFeat.id() )
192+
{
193+
mFeat.setValid( false );
194+
}
191195
setData( index( idToRow( fid ), fieldCol( idx ) ), value, Qt::EditRole );
192196
}
193197

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

471475
// if we don't have the row in current cache, load it from layer first
472-
if ( mFeat.id() != rowId )
476+
if ( mFeat.id() != rowId || !mFeat.isValid() )
473477
{
474478
if ( !loadFeatureAtId( rowId ) )
475479
return QVariant( "ERROR" );

src/gui/attributetable/qgsattributetableview.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ bool QgsAttributeTableView::eventFilter(QObject *object, QEvent *event)
7979
{
8080
if ( object == verticalHeader()->viewport() )
8181
{
82-
83-
qDebug() << "Event " << event->type();
84-
8582
switch ( event->type() )
8683
{
8784
case QEvent::MouseButtonPress:

0 commit comments

Comments
 (0)