Skip to content
Permalink
Browse files

Fix row conditional formatting

  • Loading branch information
github-actions authored and nyalldawson committed Feb 5, 2020
1 parent e172a6b commit b8046ded750fa751ad8b3cd7bdae8d9d03efe376
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/gui/attributetable/qgsattributetablemodel.cpp
@@ -711,14 +711,14 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons
{
mExpressionContext.setFeature( mFeat );
QList<QgsConditionalStyle> styles;
if ( mRowStylesMap.contains( index.row() ) )
if ( mRowStylesMap.contains( mFeat.id() ) )
{
styles = mRowStylesMap[index.row()];
styles = mRowStylesMap[mFeat.id()];
}
else
{
styles = QgsConditionalStyle::matchingConditionalStyles( layer()->conditionalStyles()->rowStyles(), QVariant(), mExpressionContext );
mRowStylesMap.insert( index.row(), styles );
mRowStylesMap.insert( mFeat.id(), styles );
}

QgsConditionalStyle rowstyle = QgsConditionalStyle::compressStyles( styles );
@@ -756,7 +756,7 @@ bool QgsAttributeTableModel::setData( const QModelIndex &index, const QVariant &
if ( !layer()->isModified() )
return false;

mRowStylesMap.remove( index.row() );
mRowStylesMap.remove( mFeat.id() );

return true;
}

0 comments on commit b8046de

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