Skip to content
Permalink
Browse files

Add cell style on top of row

  • Loading branch information
NathanW2 committed Aug 22, 2015
1 parent 323977f commit b355420131be221539caef189730dbe6eadaa98d
Showing with 3 additions and 18 deletions.
  1. +3 −18 src/gui/attributetable/qgsattributetablemodel.cpp
@@ -593,28 +593,13 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons
styles = QgsConditionalStyle::matchingConditionalStyles( layer()->rowStyles(), QVariant(), &mFeat );
mRowStylesMap.insert( index.row(), styles );

}
QgsConditionalStyle style = QgsConditionalStyle::stackStyles( styles );
// TODO Extract me out
foreach ( QgsConditionalStyle style, styles )
{
if ( style.isValid() )
{
if ( role == Qt::BackgroundColorRole && style.backgroundColor().isValid() )
return style.backgroundColor();
if ( role == Qt::TextColorRole && style.textColor().isValid() )
return style.textColor();
if ( role == Qt::DecorationRole )
return style.icon();
if ( role == Qt::FontRole )
return style.font();
}

}

QgsConditionalStyle rowstyle = QgsConditionalStyle::stackStyles( styles );
QgsFieldUIProperties props = layer()->fieldUIProperties( field.name() );
styles = QgsConditionalStyle::matchingConditionalStyles( props.conditionalStyles(), val, &mFeat );
style = QgsConditionalStyle::stackStyles( styles );
styles.insert( 0, rowstyle );
QgsConditionalStyle style = QgsConditionalStyle::stackStyles( styles );

if ( style.isValid() )
{

0 comments on commit b355420

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