Skip to content
Permalink
Browse files

Merge branch 'release-3_4' into backport-fix-help-button-group

  • Loading branch information
m-kuhn committed Feb 28, 2019
2 parents 06f595b + de0aede commit a6cdf719d25ae29c8ee54ab57fbf75a796554c29
Showing with 25 additions and 0 deletions.
  1. +1 −0 src/core/layout/qgslayoutitemattributetable.cpp
  2. +24 −0 tests/src/core/testqgslayouttable.cpp
@@ -411,6 +411,7 @@ bool QgsLayoutItemAttributeTable::getTableContents( QgsLayoutTableContents &cont
{
activeFilter = true;
req.setFilterExpression( mFeatureFilter );
req.setExpressionContext( context );
}
}

@@ -241,6 +241,30 @@ void TestQgsLayoutTable::attributeTableFilterFeatures()

//retrieve rows and check
compareTable( table, expectedRows );

table->setFeatureFilter( QStringLiteral( "\"Class\"=@airplane_class" ) );
table->setFilterFeatures( true );
expectedRows.clear();
compareTable( table, expectedRows );

QgsExpressionContextUtils::setLayoutVariable( &l, QStringLiteral( "airplane_class" ), QStringLiteral( "Biplane" ) );

row.clear();
row << QStringLiteral( "Biplane" ) << QStringLiteral( "0" ) << QStringLiteral( "1" ) << QStringLiteral( "3" ) << QStringLiteral( "3" ) << QStringLiteral( "6" );
expectedRows.append( row );
row.clear();
row << QStringLiteral( "Biplane" ) << QStringLiteral( "340" ) << QStringLiteral( "1" ) << QStringLiteral( "3" ) << QStringLiteral( "3" ) << QStringLiteral( "6" );
expectedRows.append( row );
row.clear();
row << QStringLiteral( "Biplane" ) << QStringLiteral( "300" ) << QStringLiteral( "1" ) << QStringLiteral( "3" ) << QStringLiteral( "2" ) << QStringLiteral( "5" );
expectedRows.append( row );
row.clear();
row << QStringLiteral( "Biplane" ) << QStringLiteral( "270" ) << QStringLiteral( "1" ) << QStringLiteral( "3" ) << QStringLiteral( "4" ) << QStringLiteral( "7" );
expectedRows.append( row );
row.clear();
row << QStringLiteral( "Biplane" ) << QStringLiteral( "240" ) << QStringLiteral( "1" ) << QStringLiteral( "3" ) << QStringLiteral( "2" ) << QStringLiteral( "5" );
expectedRows.append( row );
compareTable( table, expectedRows );
}

void TestQgsLayoutTable::attributeTableSetAttributes()

0 comments on commit a6cdf71

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