Skip to content

Commit

Permalink
Modify travis test
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jul 14, 2020
1 parent c964dea commit 5d3201e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/src/core/testqgslayouttable.cpp
Expand Up @@ -1063,23 +1063,21 @@ void TestQgsLayoutTable::testDataDefinedTextFormatForCell()

l.addMultiFrame( table );
QgsLayoutFrame *frame = new QgsLayoutFrame( &l, table );
frame->attemptSetSceneRect( QRectF( 5, 5, 100, 30 ) );
frame->attemptSetSceneRect( QRectF( 5, 5, 150, 30 ) );
frame->setFrameEnabled( true );
l.addLayoutItem( frame );
table->addFrame( frame );

QgsTextFormat textFormat = QgsTextFormat::fromQFont( QgsFontUtils::getStandardTestFont( QStringLiteral( "Bold" ) ) );
table->setHeaderTextFormat( textFormat );
table->setContentTextFormat( textFormat );
table->refresh();

QCOMPARE( table->totalHeight(), 150.0 );

textFormat.dataDefinedProperties().setProperty( QgsPalLayerSettings::Size, QgsProperty::fromExpression( QStringLiteral( "if(@column_number = 1,30,5)" ) ) );
textFormat.dataDefinedProperties().setProperty( QgsPalLayerSettings::Size, QgsProperty::fromExpression( QStringLiteral( "if(@column_number = 1,35,15)" ) ) );
table->setContentTextFormat( textFormat );
table->refresh();

QCOMPARE( table->totalHeight(), 270.0 );
QgsLayoutChecker checker( QStringLiteral( "composerattributetable_datadefinedtextformat" ), &l );
checker.setControlPathPrefix( QStringLiteral( "composer_table" ) );
bool result = checker.testLayout( mReport );
QVERIFY( result );
}

void TestQgsLayoutTable::align()
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5d3201e

Please sign in to comment.