diff --git a/src/gui/attributetable/qgsattributetablemodel.cpp b/src/gui/attributetable/qgsattributetablemodel.cpp index fdb5ac6a92ff..80d72252a83a 100644 --- a/src/gui/attributetable/qgsattributetablemodel.cpp +++ b/src/gui/attributetable/qgsattributetablemodel.cpp @@ -679,7 +679,7 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons case Qt::EditRole: return val; - case Qt::BackgroundColorRole: + case Qt::BackgroundRole: case Qt::TextColorRole: case Qt::DecorationRole: case Qt::FontRole: @@ -704,7 +704,7 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons if ( style.isValid() ) { - if ( role == Qt::BackgroundColorRole && style.validBackgroundColor() ) + if ( role == Qt::BackgroundRole && style.validBackgroundColor() ) return style.backgroundColor(); if ( role == Qt::TextColorRole && style.validTextColor() ) return style.textColor(); @@ -755,6 +755,8 @@ bool QgsAttributeTableModel::setData( const QModelIndex &index, const QVariant & } } + mRowStylesMap.remove( index.row() ); + return true; }