Rebuild composer test images at 96 dpi to speed up unit tests
@ -43,25 +43,26 @@ bool QgsCompositionChecker::testComposition( QString &report, int page, int pixe
|
||||
return false;
|
||||
}
|
||||
|
||||
setControlName( "expected_" + mTestName );
|
||||
|
||||
#if 0
|
||||
//fake mode to generate expected image
|
||||
//assume 300 dpi and size of the control image 3507 * 2480
|
||||
QImage outputImage( QSize( 3507, 2480 ), QImage::Format_ARGB32 );
|
||||
//assume 96 dpi and size of the control image 1122 * 794
|
||||
QImage newImage( QSize( 1122, 794 ), QImage::Format_ARGB32 );
|
||||
mComposition->setPlotStyle( QgsComposition::Print );
|
||||
outputImage.setDotsPerMeterX( 300 / 25.4 * 1000 );
|
||||
outputImage.setDotsPerMeterY( 300 / 25.4 * 1000 );
|
||||
outputImage.fill( 0 );
|
||||
QPainter p( &outputImage );
|
||||
newImage.setDotsPerMeterX( 96 / 25.4 * 1000 );
|
||||
newImage.setDotsPerMeterY( 96 / 25.4 * 1000 );
|
||||
newImage.fill( 0 );
|
||||
QPainter expectedPainter( &newImage );
|
||||
//QRectF sourceArea( 0, 0, mComposition->paperWidth(), mComposition->paperHeight() );
|
||||
//QRectF targetArea( 0, 0, 3507, 2480 );
|
||||
mComposition->renderPage( &p, page );
|
||||
p.end();
|
||||
outputImage.save( "/tmp/composerhtml_table_control.png", "PNG" );
|
||||
return false;
|
||||
mComposition->renderPage( &expectedPainter, page );
|
||||
expectedPainter.end();
|
||||
newImage.save( mExpectedImageFile, "PNG" );
|
||||
return true;
|
||||
#endif //0
|
||||
|
||||
//load expected image
|
||||
setControlName( "expected_" + mTestName );
|
||||
QImage expectedImage( mExpectedImageFile );
|
||||
|
||||
//get width/height, create image and render the composition to it
|
||||
|
@ -216,7 +216,7 @@ void TestQgsAtlasComposition::autoscale_render()
|
||||
mLabel1->adjustSizeToText();
|
||||
|
||||
QgsCompositionChecker checker( QString( "atlas_autoscale%1" ).arg((( int )fit ) + 1 ), mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
}
|
||||
mAtlas->endRender();
|
||||
mAtlasMap->setAtlasDriven( false );
|
||||
@ -239,7 +239,7 @@ void TestQgsAtlasComposition::autoscale_render_2_0_api()
|
||||
mLabel1->adjustSizeToText();
|
||||
|
||||
QgsCompositionChecker checker( QString( "atlas_autoscale_old_api%1" ).arg((( int )fit ) + 1 ), mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
}
|
||||
mAtlas->endRender();
|
||||
Q_NOWARN_DEPRECATED_PUSH
|
||||
@ -263,7 +263,7 @@ void TestQgsAtlasComposition::fixedscale_render()
|
||||
mLabel1->adjustSizeToText();
|
||||
|
||||
QgsCompositionChecker checker( QString( "atlas_fixedscale%1" ).arg((( int )fit ) + 1 ), mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
}
|
||||
mAtlas->endRender();
|
||||
|
||||
@ -285,7 +285,7 @@ void TestQgsAtlasComposition::fixedscale_render_2_0_api()
|
||||
mLabel1->adjustSizeToText();
|
||||
|
||||
QgsCompositionChecker checker( QString( "atlas_fixedscale_old_api%1" ).arg((( int )fit ) + 1 ), mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
}
|
||||
mAtlas->endRender();
|
||||
Q_NOWARN_DEPRECATED_PUSH
|
||||
@ -321,7 +321,7 @@ void TestQgsAtlasComposition::predefinedscales_render()
|
||||
mLabel1->adjustSizeToText();
|
||||
|
||||
QgsCompositionChecker checker( QString( "atlas_predefinedscales%1" ).arg((( int )fit ) + 1 ), mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
}
|
||||
mAtlas->endRender();
|
||||
|
||||
@ -345,7 +345,7 @@ void TestQgsAtlasComposition::two_map_autoscale_render()
|
||||
mLabel1->adjustSizeToText();
|
||||
|
||||
QgsCompositionChecker checker( QString( "atlas_two_maps%1" ).arg((( int )fit ) + 1 ), mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
}
|
||||
mAtlas->endRender();
|
||||
mAtlasMap->setAtlasDriven( false );
|
||||
@ -368,7 +368,7 @@ void TestQgsAtlasComposition::hiding_render()
|
||||
mLabel1->adjustSizeToText();
|
||||
|
||||
QgsCompositionChecker checker( QString( "atlas_hiding%1" ).arg((( int )fit ) + 1 ), mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
}
|
||||
mAtlas->endRender();
|
||||
}
|
||||
@ -392,7 +392,7 @@ void TestQgsAtlasComposition::sorting_render()
|
||||
mLabel1->adjustSizeToText();
|
||||
|
||||
QgsCompositionChecker checker( QString( "atlas_sorting%1" ).arg((( int )fit ) + 1 ), mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
}
|
||||
mAtlas->endRender();
|
||||
}
|
||||
@ -417,7 +417,7 @@ void TestQgsAtlasComposition::filtering_render()
|
||||
mLabel1->adjustSizeToText();
|
||||
|
||||
QgsCompositionChecker checker( QString( "atlas_filtering%1" ).arg((( int )fit ) + 1 ), mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
}
|
||||
mAtlas->endRender();
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ void TestQgsComposerMap::render()
|
||||
mComposerMap->setNewExtent( QgsRectangle( 781662.375, 3339523.125, 793062.375, 3345223.125 ) );
|
||||
QgsCompositionChecker checker( "composermap_render", mComposition );
|
||||
|
||||
QVERIFY( checker.testComposition( mReport, 0, 100 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
}
|
||||
|
||||
void TestQgsComposerMap::uniqueId()
|
||||
|
@ -119,7 +119,7 @@ void TestQgsComposerMapGrid::grid()
|
||||
qWarning() << "grid annotation font: " << mComposerMap->grid()->annotationFont().toString() << " exactMatch:" << mComposerMap->grid()->annotationFont().exactMatch();
|
||||
QgsCompositionChecker checker( "composermap_grid", mComposition );
|
||||
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
mComposerMap->grid()->setEnabled( false );
|
||||
mComposerMap->grid()->setAnnotationEnabled( false );
|
||||
QVERIFY( testResult );
|
||||
@ -139,7 +139,7 @@ void TestQgsComposerMapGrid::crossGrid()
|
||||
mComposerMap->grid()->setBlendMode( QPainter::CompositionMode_SourceOver );
|
||||
QgsCompositionChecker checker( "composermap_crossgrid", mComposition );
|
||||
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
mComposerMap->grid()->setStyle( QgsComposerMapGrid::Solid );
|
||||
mComposerMap->grid()->setEnabled( false );
|
||||
mComposerMap->grid()->setAnnotationEnabled( false );
|
||||
@ -157,7 +157,7 @@ void TestQgsComposerMapGrid::markerGrid()
|
||||
mComposerMap->grid()->setBlendMode( QPainter::CompositionMode_SourceOver );
|
||||
QgsCompositionChecker checker( "composermap_markergrid", mComposition );
|
||||
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
mComposerMap->grid()->setStyle( QgsComposerMapGrid::Solid );
|
||||
mComposerMap->grid()->setEnabled( false );
|
||||
mComposerMap->grid()->setAnnotationEnabled( false );
|
||||
@ -178,7 +178,7 @@ void TestQgsComposerMapGrid::frameOnly()
|
||||
mComposerMap->grid()->setBlendMode( QPainter::CompositionMode_SourceOver );
|
||||
QgsCompositionChecker checker( "composermap_gridframeonly", mComposition );
|
||||
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
mComposerMap->grid()->setStyle( QgsComposerMapGrid::Solid );
|
||||
mComposerMap->grid()->setEnabled( false );
|
||||
mComposerMap->grid()->setAnnotationEnabled( false );
|
||||
@ -203,7 +203,7 @@ void TestQgsComposerMapGrid::zebraStyle()
|
||||
|
||||
QgsCompositionChecker checker( "composermap_zebrastyle", mComposition );
|
||||
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult );
|
||||
}
|
||||
|
||||
@ -228,17 +228,17 @@ void TestQgsComposerMapGrid::zebraStyleSides()
|
||||
mComposerMap->grid()->setFrameSideFlag( QgsComposerMapGrid::FrameBottom, false );
|
||||
|
||||
QgsCompositionChecker checker( "composermap_zebrastyle_left", mComposition );
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult );
|
||||
|
||||
mComposerMap->grid()->setFrameSideFlag( QgsComposerMapGrid::FrameTop, true );
|
||||
QgsCompositionChecker checker2( "composermap_zebrastyle_lefttop", mComposition );
|
||||
bool testResult2 = checker2.testComposition( mReport, 0, 100 );
|
||||
bool testResult2 = checker2.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult2 );
|
||||
|
||||
mComposerMap->grid()->setFrameSideFlag( QgsComposerMapGrid::FrameRight, true );
|
||||
QgsCompositionChecker checker3( "composermap_zebrastyle_lefttopright", mComposition );
|
||||
bool testResult3 = checker3.testComposition( mReport, 0, 100 );
|
||||
bool testResult3 = checker3.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult3 );
|
||||
|
||||
mComposerMap->grid()->setFrameSideFlag( QgsComposerMapGrid::FrameBottom, true );
|
||||
@ -258,7 +258,7 @@ void TestQgsComposerMapGrid::interiorTicks()
|
||||
mComposerMap->grid()->setStyle( QgsComposerMapGrid::FrameAnnotationsOnly );
|
||||
|
||||
QgsCompositionChecker checker( "composermap_interiorticks", mComposition );
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult );
|
||||
|
||||
mComposerMap->grid()->setFrameStyle( QgsComposerMapGrid::NoFrame );
|
||||
@ -282,7 +282,7 @@ void TestQgsComposerMapGrid::interiorTicksAnnotated()
|
||||
mComposerMap->grid()->setAnnotationPosition( QgsComposerMapGrid::InsideMapFrame, QgsComposerMapGrid::Bottom );
|
||||
|
||||
QgsCompositionChecker checker( "composermap_interiorticks_annotated", mComposition );
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult );
|
||||
|
||||
mComposerMap->grid()->setAnnotationPosition( QgsComposerMapGrid::OutsideMapFrame, QgsComposerMapGrid::Left );
|
||||
@ -291,7 +291,7 @@ void TestQgsComposerMapGrid::interiorTicksAnnotated()
|
||||
mComposerMap->grid()->setAnnotationPosition( QgsComposerMapGrid::OutsideMapFrame, QgsComposerMapGrid::Bottom );
|
||||
|
||||
QgsCompositionChecker checker2( "composermap_interiorticks_annotated2", mComposition );
|
||||
bool testResult2 = checker2.testComposition( mReport, 0, 100 );
|
||||
bool testResult2 = checker2.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult2 );
|
||||
|
||||
mComposerMap->grid()->setFrameStyle( QgsComposerMapGrid::NoFrame );
|
||||
@ -310,7 +310,7 @@ void TestQgsComposerMapGrid::exteriorTicks()
|
||||
mComposerMap->grid()->setStyle( QgsComposerMapGrid::FrameAnnotationsOnly );
|
||||
|
||||
QgsCompositionChecker checker( "composermap_exteriorticks", mComposition );
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult );
|
||||
|
||||
mComposerMap->grid()->setFrameStyle( QgsComposerMapGrid::NoFrame );
|
||||
@ -334,7 +334,7 @@ void TestQgsComposerMapGrid::exteriorTicksAnnotated()
|
||||
mComposerMap->grid()->setAnnotationPosition( QgsComposerMapGrid::InsideMapFrame, QgsComposerMapGrid::Bottom );
|
||||
|
||||
QgsCompositionChecker checker( "composermap_exteriorticks_annotated", mComposition );
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult );
|
||||
|
||||
mComposerMap->grid()->setAnnotationPosition( QgsComposerMapGrid::OutsideMapFrame, QgsComposerMapGrid::Left );
|
||||
@ -343,7 +343,7 @@ void TestQgsComposerMapGrid::exteriorTicksAnnotated()
|
||||
mComposerMap->grid()->setAnnotationPosition( QgsComposerMapGrid::OutsideMapFrame, QgsComposerMapGrid::Bottom );
|
||||
|
||||
QgsCompositionChecker checker2( "composermap_exteriorticks_annotated2", mComposition );
|
||||
bool testResult2 = checker2.testComposition( mReport, 0, 100 );
|
||||
bool testResult2 = checker2.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult2 );
|
||||
|
||||
mComposerMap->grid()->setFrameStyle( QgsComposerMapGrid::NoFrame );
|
||||
@ -362,7 +362,7 @@ void TestQgsComposerMapGrid::interiorExteriorTicks()
|
||||
mComposerMap->grid()->setStyle( QgsComposerMapGrid::FrameAnnotationsOnly );
|
||||
|
||||
QgsCompositionChecker checker( "composermap_interiorexteriorticks", mComposition );
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult );
|
||||
|
||||
mComposerMap->grid()->setFrameStyle( QgsComposerMapGrid::NoFrame );
|
||||
@ -386,7 +386,7 @@ void TestQgsComposerMapGrid::interiorExteriorTicksAnnotated()
|
||||
mComposerMap->grid()->setAnnotationPosition( QgsComposerMapGrid::InsideMapFrame, QgsComposerMapGrid::Bottom );
|
||||
|
||||
QgsCompositionChecker checker( "composermap_interiorexteriorticks_annotated", mComposition );
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult );
|
||||
|
||||
mComposerMap->grid()->setAnnotationPosition( QgsComposerMapGrid::OutsideMapFrame, QgsComposerMapGrid::Left );
|
||||
@ -395,7 +395,7 @@ void TestQgsComposerMapGrid::interiorExteriorTicksAnnotated()
|
||||
mComposerMap->grid()->setAnnotationPosition( QgsComposerMapGrid::OutsideMapFrame, QgsComposerMapGrid::Bottom );
|
||||
|
||||
QgsCompositionChecker checker2( "composermap_interiorexteriorticks_annotated2", mComposition );
|
||||
bool testResult2 = checker2.testComposition( mReport, 0, 100 );
|
||||
bool testResult2 = checker2.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult2 );
|
||||
|
||||
mComposerMap->grid()->setFrameStyle( QgsComposerMapGrid::NoFrame );
|
||||
@ -414,7 +414,7 @@ void TestQgsComposerMapGrid::lineBorder()
|
||||
mComposerMap->grid()->setStyle( QgsComposerMapGrid::FrameAnnotationsOnly );
|
||||
|
||||
QgsCompositionChecker checker( "composermap_lineborder", mComposition );
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult );
|
||||
|
||||
mComposerMap->grid()->setFrameStyle( QgsComposerMapGrid::NoFrame );
|
||||
@ -438,7 +438,7 @@ void TestQgsComposerMapGrid::lineBorderAnnotated()
|
||||
mComposerMap->grid()->setAnnotationPosition( QgsComposerMapGrid::InsideMapFrame, QgsComposerMapGrid::Bottom );
|
||||
|
||||
QgsCompositionChecker checker( "composermap_lineborder_annotated", mComposition );
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult );
|
||||
|
||||
mComposerMap->grid()->setAnnotationPosition( QgsComposerMapGrid::OutsideMapFrame, QgsComposerMapGrid::Left );
|
||||
@ -447,7 +447,7 @@ void TestQgsComposerMapGrid::lineBorderAnnotated()
|
||||
mComposerMap->grid()->setAnnotationPosition( QgsComposerMapGrid::OutsideMapFrame, QgsComposerMapGrid::Bottom );
|
||||
|
||||
QgsCompositionChecker checker2( "composermap_lineborder_annotated2", mComposition );
|
||||
bool testResult2 = checker2.testComposition( mReport, 0, 100 );
|
||||
bool testResult2 = checker2.testComposition( mReport, 0, 0 );
|
||||
QVERIFY( testResult2 );
|
||||
|
||||
mComposerMap->grid()->setFrameStyle( QgsComposerMapGrid::NoFrame );
|
||||
|
@ -111,7 +111,7 @@ void TestQgsComposerMapOverview::overviewMap()
|
||||
overviewMap->overview()->setFrameMap( mComposerMap->id() );
|
||||
QgsCompositionChecker checker( "composermap_overview", mComposition );
|
||||
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
mComposition->removeComposerItem( overviewMap );
|
||||
QVERIFY( testResult );
|
||||
}
|
||||
@ -127,7 +127,7 @@ void TestQgsComposerMapOverview::overviewMapRotated()
|
||||
overviewMap->overview()->setFrameMap( mComposerMap->id() );
|
||||
QgsCompositionChecker checker( "composermap_overview_rotated", mComposition );
|
||||
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
mComposition->removeComposerItem( overviewMap );
|
||||
mComposerMap->setMapRotation( 0 );
|
||||
QVERIFY( testResult );
|
||||
@ -144,7 +144,7 @@ void TestQgsComposerMapOverview::overviewMapRotated2()
|
||||
overviewMap->overview()->setFrameMap( mComposerMap->id() );
|
||||
QgsCompositionChecker checker( "composermap_overview_rotated2", mComposition );
|
||||
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
mComposition->removeComposerItem( overviewMap );
|
||||
QVERIFY( testResult );
|
||||
}
|
||||
@ -161,7 +161,7 @@ void TestQgsComposerMapOverview::overviewMapBlending()
|
||||
|
||||
QgsCompositionChecker checker( "composermap_overview_blending", mComposition );
|
||||
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
mComposition->removeComposerItem( overviewMapBlend );
|
||||
QVERIFY( testResult );
|
||||
}
|
||||
@ -178,7 +178,7 @@ void TestQgsComposerMapOverview::overviewMapInvert()
|
||||
|
||||
QgsCompositionChecker checker( "composermap_overview_invert", mComposition );
|
||||
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
mComposition->removeComposerItem( overviewMapInvert );
|
||||
QVERIFY( testResult );
|
||||
}
|
||||
@ -195,7 +195,7 @@ void TestQgsComposerMapOverview::overviewMapCenter()
|
||||
|
||||
QgsCompositionChecker checker( "composermap_overview_center", mComposition );
|
||||
|
||||
bool testResult = checker.testComposition( mReport, 0, 100 );
|
||||
bool testResult = checker.testComposition( mReport, 0, 0 );
|
||||
mComposition->removeComposerItem( overviewMapCenter );
|
||||
QVERIFY( testResult );
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ void TestQgsComposerPaper::markerLinePaper()
|
||||
{
|
||||
mComposition->setPageStyleSymbol( mMarkerLineSymbol );
|
||||
QgsCompositionChecker checker( "composerpaper_markerborder", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 60 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
}
|
||||
|
||||
QTEST_MAIN( TestQgsComposerPaper )
|
||||
|
@ -116,7 +116,7 @@ void TestQgsComposerPicture::pictureRotation()
|
||||
mComposerPicture->setPictureRotation( 45 );
|
||||
|
||||
QgsCompositionChecker checker( "composerpicture_rotation", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 100 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
|
||||
mComposition->removeItem( mComposerPicture );
|
||||
mComposerPicture->setPictureRotation( 0 );
|
||||
@ -129,7 +129,7 @@ void TestQgsComposerPicture::pictureItemRotation()
|
||||
mComposerPicture->setItemRotation( 45, true );
|
||||
|
||||
QgsCompositionChecker checker( "composerpicture_itemrotation", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 100 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
|
||||
mComposition->removeItem( mComposerPicture );
|
||||
mComposerPicture->setItemRotation( 0, true );
|
||||
@ -157,7 +157,7 @@ void TestQgsComposerPicture::pictureResizeZoom()
|
||||
mComposerPicture->setResizeMode( QgsComposerPicture::Zoom );
|
||||
|
||||
QgsCompositionChecker checker( "composerpicture_resize_zoom", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 100 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
|
||||
mComposition->removeItem( mComposerPicture );
|
||||
}
|
||||
@ -169,7 +169,7 @@ void TestQgsComposerPicture::pictureResizeStretch()
|
||||
mComposerPicture->setResizeMode( QgsComposerPicture::Stretch );
|
||||
|
||||
QgsCompositionChecker checker( "composerpicture_resize_stretch", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 100 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
|
||||
mComposition->removeItem( mComposerPicture );
|
||||
mComposerPicture->setResizeMode( QgsComposerPicture::Zoom );
|
||||
@ -263,7 +263,7 @@ void TestQgsComposerPicture::pictureZoomAnchor()
|
||||
mComposerPicture->setPictureAnchor( QgsComposerItem::LowerMiddle );
|
||||
|
||||
QgsCompositionChecker checker( "composerpicture_zoom_anchor", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 100 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
|
||||
mComposition->removeItem( mComposerPicture );
|
||||
mComposerPicture->setPictureAnchor( QgsComposerItem::UpperLeft );
|
||||
@ -278,7 +278,7 @@ void TestQgsComposerPicture::pictureSvgZoom()
|
||||
mComposerPicture->setPicturePath( mSvgImage );
|
||||
|
||||
QgsCompositionChecker checker( "composerpicture_svg_zoom", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 100 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
|
||||
mComposition->removeItem( mComposerPicture );
|
||||
mComposerPicture->setPicturePath( mPngImage );
|
||||
@ -293,7 +293,7 @@ void TestQgsComposerPicture::pictureSvgStretch()
|
||||
mComposerPicture->setSceneRect( QRectF( 70, 70, 20, 100 ) );
|
||||
|
||||
QgsCompositionChecker checker( "composerpicture_svg_stretch", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 100 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
|
||||
mComposition->removeItem( mComposerPicture );
|
||||
mComposerPicture->setResizeMode( QgsComposerPicture::Zoom );
|
||||
@ -345,7 +345,7 @@ void TestQgsComposerPicture::pictureExpression()
|
||||
mComposerPicture->setUsePictureExpression( true );
|
||||
|
||||
QgsCompositionChecker checker( "composerpicture_expression", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 100 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
|
||||
mComposition->removeItem( mComposerPicture );
|
||||
mComposerPicture->setUsePictureExpression( false );
|
||||
@ -361,7 +361,7 @@ void TestQgsComposerPicture::pictureInvalidExpression()
|
||||
mComposerPicture->setUsePictureExpression( true );
|
||||
|
||||
QgsCompositionChecker checker( "composerpicture_badexpression", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 100 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
|
||||
mComposition->removeItem( mComposerPicture );
|
||||
mComposerPicture->setUsePictureExpression( false );
|
||||
@ -375,7 +375,7 @@ void TestQgsComposerPicture::pictureRemoteUrl()
|
||||
mComposerPicture->setPicturePath( "http://www.qgis.org/en/_static/logo.png" );
|
||||
|
||||
QgsCompositionChecker checker( "composerpicture_remote", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 100 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
|
||||
mComposition->removeItem( mComposerPicture );
|
||||
mComposerPicture->setUsePictureExpression( false );
|
||||
|
@ -156,7 +156,7 @@ void TestQgsComposerRotation::labelRotation()
|
||||
mComposerLabel->setItemRotation( 135, true );
|
||||
|
||||
QgsCompositionChecker checker( "composerrotation_label", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 20 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
|
||||
// removeItem() for label does not work, the label is rendered in the next test
|
||||
// cannot find why, other items are removed correctly
|
||||
@ -187,7 +187,7 @@ void TestQgsComposerRotation::mapRotation()
|
||||
mComposerMap->setMapRotation( 90 );
|
||||
|
||||
QgsCompositionChecker checker( "composerrotation_maprotation", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 100 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
|
||||
mComposition->removeItem( mComposerMap );
|
||||
mComposerMap->setMapRotation( 0 );
|
||||
|
@ -127,7 +127,7 @@ void TestQgsComposerScaleBar::singleBox()
|
||||
{
|
||||
mComposerScaleBar->setStyle( "Single Box" );
|
||||
QgsCompositionChecker checker( "composerscalebar_singlebox", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 20 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
};
|
||||
|
||||
void TestQgsComposerScaleBar::singleBoxAlpha()
|
||||
@ -141,7 +141,7 @@ void TestQgsComposerScaleBar::singleBoxAlpha()
|
||||
mComposerScaleBar->setPen( newPen );
|
||||
mComposerScaleBar->setFontColor( QColor( 255, 0, 255, 100 ) );
|
||||
QgsCompositionChecker checker( "composerscalebar_singlebox_alpha", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 20 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
mComposerScaleBar->setBrush( QBrush( Qt::black ) );
|
||||
mComposerScaleBar->setBrush2( QBrush( Qt::white ) );
|
||||
mComposerScaleBar->setPen( prevPen );
|
||||
@ -152,7 +152,7 @@ void TestQgsComposerScaleBar::doubleBox()
|
||||
{
|
||||
mComposerScaleBar->setStyle( "Double Box" );
|
||||
QgsCompositionChecker checker( "composerscalebar_doublebox", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 20 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
};
|
||||
|
||||
void TestQgsComposerScaleBar::numeric()
|
||||
@ -160,14 +160,14 @@ void TestQgsComposerScaleBar::numeric()
|
||||
mComposerScaleBar->setStyle( "Numeric" );
|
||||
mComposerScaleBar->setSceneRect( QRectF( 20, 180, 50, 20 ) );
|
||||
QgsCompositionChecker checker( "composerscalebar_numeric", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 20 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
};
|
||||
|
||||
void TestQgsComposerScaleBar::tick()
|
||||
{
|
||||
mComposerScaleBar->setStyle( "Line Ticks Up" );
|
||||
QgsCompositionChecker checker( "composerscalebar_tick", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 20 ) );
|
||||
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
|
||||
};
|
||||
|
||||
QTEST_MAIN( TestQgsComposerScaleBar )
|
||||
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 195 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 195 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 188 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 188 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 464 KiB After Width: | Height: | Size: 189 KiB |
Before Width: | Height: | Size: 554 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 247 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 155 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 224 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 261 KiB After Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 260 KiB After Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 261 KiB After Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 259 KiB After Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 261 KiB After Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 14 KiB |