Skip to content

Commit

Permalink
Fix failing atlas test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 14, 2014
1 parent 24b0a64 commit f9f5c6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/src/core/testqgsatlascomposition.cpp
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions tests/src/python/test_qgsatlascomposition.py
Expand Up @@ -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() ) )

Expand All @@ -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() ) )

Expand Down

0 comments on commit f9f5c6d

Please sign in to comment.