Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Aug 11, 2020
1 parent f3d3248 commit be49737
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/src/analysis/testqgsprocessingalgs.cpp
Expand Up @@ -4613,8 +4613,9 @@ void TestQgsProcessingAlgs::exportLayoutPng()

void TestQgsProcessingAlgs::exportAtlasLayoutPdf()
{
QgsMapLayer *polygonLayer = mPolygonLayer->clone();
QgsProject p;
p.addMapLayers( QList<QgsMapLayer *>() << mPolygonLayer );
p.addMapLayers( QList<QgsMapLayer *>() << polygonLayer );

QgsPrintLayout *layout = new QgsPrintLayout( &p );
layout->initializeDefaults();
Expand All @@ -4625,7 +4626,7 @@ void TestQgsProcessingAlgs::exportAtlasLayoutPdf()
map->setFrameEnabled( false );
map->attemptSetSceneRect( QRectF( 20, 20, 200, 100 ) );
layout->addLayoutItem( map );
map->setExtent( mPolygonLayer->extent() );
map->setExtent( polygonLayer->extent() );

p.layoutManager()->addLayout( layout );

Expand All @@ -4638,7 +4639,7 @@ void TestQgsProcessingAlgs::exportAtlasLayoutPdf()

QVariantMap parameters;
parameters.insert( QStringLiteral( "LAYOUT" ), QStringLiteral( "my layout" ) );
parameters.insert( QStringLiteral( "COVERAGE_LAYER" ), QVariant::fromValue( mPolygonLayer ) );
parameters.insert( QStringLiteral( "COVERAGE_LAYER" ), QVariant::fromValue( polygonLayer ) );
parameters.insert( QStringLiteral( "OUTPUT" ), outputPdf );
parameters.insert( QStringLiteral( "DPI" ), 96 );

Expand All @@ -4655,8 +4656,9 @@ void TestQgsProcessingAlgs::exportAtlasLayoutPdf()

void TestQgsProcessingAlgs::exportAtlasLayoutPng()
{
QgsMapLayer *polygonLayer = mPolygonLayer->clone();
QgsProject p;
p.addMapLayers( QList<QgsMapLayer *>() << mPolygonLayer );
p.addMapLayers( QList<QgsMapLayer *>() << polygonLayer );

QgsPrintLayout *layout = new QgsPrintLayout( &p );
layout->initializeDefaults();
Expand All @@ -4667,7 +4669,7 @@ void TestQgsProcessingAlgs::exportAtlasLayoutPng()
map->setFrameEnabled( false );
map->attemptSetSceneRect( QRectF( 20, 20, 200, 100 ) );
layout->addLayoutItem( map );
map->setExtent( mPolygonLayer->extent() );
map->setExtent( polygonLayer->extent() );

p.layoutManager()->addLayout( layout );

Expand All @@ -4685,7 +4687,7 @@ void TestQgsProcessingAlgs::exportAtlasLayoutPng()

QVariantMap parameters;
parameters.insert( QStringLiteral( "LAYOUT" ), QStringLiteral( "my layout" ) );
parameters.insert( QStringLiteral( "COVERAGE_LAYER" ), QVariant::fromValue( mPolygonLayer ) );
parameters.insert( QStringLiteral( "COVERAGE_LAYER" ), QVariant::fromValue( polygonLayer ) );
parameters.insert( QStringLiteral( "FOLDER" ), QDir::tempPath() + "/my_atlas" );
parameters.insert( QStringLiteral( "FILENAME_EXPRESSION" ), QStringLiteral( "'export_'||@atlas_featurenumber" ) );
parameters.insert( QStringLiteral( "DPI" ), 96 );
Expand Down

0 comments on commit be49737

Please sign in to comment.