Skip to content
Permalink
Browse files
Fix failing atlas test
  • Loading branch information
nyalldawson committed Feb 14, 2014
1 parent 24b0a64 commit f9f5c6d2a97747a6bb9e4ca720c7730892749cfb
Showing with 6 additions and 6 deletions.
  1. +4 −4 tests/src/core/testqgsatlascomposition.cpp
  2. +2 −2 tests/src/python/test_qgsatlascomposition.py
@@ -131,15 +131,15 @@ void TestQgsAtlasComposition::initTestCase()
mLabel1 = new QgsComposerLabel( mComposition );
mComposition->addComposerLabel( mLabel1 );
mLabel1->setText( "[% \"NAME_1\" %] area" );
mLabel1->adjustSizeToText();
mLabel1->setItemPosition( 150, 5 );
//next to explicetly set width, since expression isn't yet evaulated against
//an atlas feature and will be shorter then required
mLabel1->setSceneRect( QRectF( 150, 5, 60, 15 ) );

// feature number label
mLabel2 = new QgsComposerLabel( mComposition );
mComposition->addComposerLabel( mLabel2 );
mLabel2->setText( "# [%$feature || ' / ' || $numfeatures%]" );
mLabel2->adjustSizeToText();
mLabel2->setItemPosition( 150, 200 );
mLabel2->setSceneRect( QRectF( 150, 200, 60, 15 ) );

qWarning() << "header label font: " << mLabel1->font().toString() << " exactMatch:" << mLabel1->font().exactMatch();
qWarning() << "feature number label font: " << mLabel2->font().toString() << " exactMatch:" << mLabel2->font().exactMatch();
@@ -83,7 +83,7 @@ def testCase(self):
self.mComposition.addComposerLabel( self.mLabel1 )
self.mLabel1.setText( "[% \"NAME_1\" %] area" )
self.mLabel1.adjustSizeToText()
self.mLabel1.setItemPosition( 150, 5 )
self.mLabel1.setSceneRect( QRectF( 150, 5, 60, 15 ) )

qWarning( "header label font: %s exactMatch:%s" % ( self.mLabel1.font().toString(), self.mLabel1.font().exactMatch() ) )

@@ -92,7 +92,7 @@ def testCase(self):
self.mComposition.addComposerLabel( self.mLabel2 )
self.mLabel2.setText( "# [%$feature || ' / ' || $numfeatures%]" )
self.mLabel2.adjustSizeToText()
self.mLabel2.setItemPosition( 150, 200 )
self.mLabel2.setSceneRect( QRectF( 150, 200, 60, 15 ) )

qWarning( "feature number label font: %s exactMatch:%s" % ( self.mLabel2.font().toString(), self.mLabel2.font().exactMatch() ) )

0 comments on commit f9f5c6d

Please sign in to comment.