Skip to content
Permalink
Browse files
[composer] Fix multiple refresh of items
  • Loading branch information
nyalldawson committed May 25, 2014
1 parent 6375f64 commit 932998008510f9c3becfce03f6fa66d9e2a3435e
@@ -56,10 +56,8 @@ QgsComposerLabel::QgsComposerLabel( QgsComposition *composition ):
setExpressionContext( mComposition->atlasComposition().currentFeature(), mComposition->atlasComposition().coverageLayer() );
}

//connect to atlas toggling on/off and coverage layer and feature changes
//connect to atlas feature changes
//to update the expression context
connect( &mComposition->atlasComposition(), SIGNAL( toggled( bool ) ), this, SLOT( refreshExpressionContext() ) );
connect( &mComposition->atlasComposition(), SIGNAL( coverageLayerChanged( QgsVectorLayer* ) ), this, SLOT( refreshExpressionContext() ) );
connect( &mComposition->atlasComposition(), SIGNAL( featureChanged( QgsFeature* ) ), this, SLOT( refreshExpressionContext() ) );

}
@@ -62,12 +62,8 @@ void QgsComposerPicture::init()
{
//connect some signals

//connect to atlas toggling on/off and coverage layer changes
//to update the picture source expression
connect( &mComposition->atlasComposition(), SIGNAL( toggled( bool ) ), this, SLOT( updatePictureExpression() ) );
connect( &mComposition->atlasComposition(), SIGNAL( coverageLayerChanged( QgsVectorLayer* ) ), this, SLOT( updatePictureExpression() ) );

//connect to atlas feature changing
//to update the picture source expression
connect( &mComposition->atlasComposition(), SIGNAL( featureChanged( QgsFeature* ) ), this, SLOT( refreshPicture() ) );

//connect to composer print resolution changing
@@ -33,10 +33,8 @@ QgsComposerShape::QgsComposerShape( QgsComposition* composition ): QgsComposerIt

if ( mComposition )
{
//connect to atlas toggling on/off and coverage layer and feature changes
//connect to atlas feature changes
//to update symbol style (in case of data-defined symbology)
connect( &mComposition->atlasComposition(), SIGNAL( toggled( bool ) ), this, SLOT( repaint() ) );
connect( &mComposition->atlasComposition(), SIGNAL( coverageLayerChanged( QgsVectorLayer* ) ), this, SLOT( repaint() ) );
connect( &mComposition->atlasComposition(), SIGNAL( featureChanged( QgsFeature* ) ), this, SLOT( repaint() ) );
}
}
@@ -55,10 +53,8 @@ QgsComposerShape::QgsComposerShape( qreal x, qreal y, qreal width, qreal height,

if ( mComposition )
{
//connect to atlas toggling on/off and coverage layer and feature changes
//connect to atlas feature changes
//to update symbol style (in case of data-defined symbology)
connect( &mComposition->atlasComposition(), SIGNAL( toggled( bool ) ), this, SLOT( repaint() ) );
connect( &mComposition->atlasComposition(), SIGNAL( coverageLayerChanged( QgsVectorLayer* ) ), this, SLOT( repaint() ) );
connect( &mComposition->atlasComposition(), SIGNAL( featureChanged( QgsFeature* ) ), this, SLOT( repaint() ) );
}
}
@@ -260,10 +260,8 @@ void QgsPaperItem::initialize()
mPageGrid = new QgsPaperGrid( pos().x(), pos().y(), rect().width(), rect().height(), mComposition );
mComposition->addItem( mPageGrid );

//connect to atlas toggling on/off and coverage layer and feature changes
//connect to atlas feature changes
//to update symbol style (in case of data-defined symbology)
connect( &mComposition->atlasComposition(), SIGNAL( toggled( bool ) ), this, SLOT( repaint() ) );
connect( &mComposition->atlasComposition(), SIGNAL( coverageLayerChanged( QgsVectorLayer* ) ), this, SLOT( repaint() ) );
connect( &mComposition->atlasComposition(), SIGNAL( featureChanged( QgsFeature* ) ), this, SLOT( repaint() ) );
}
}
@@ -243,7 +243,7 @@ void TestQgsComposerPicture::pictureClipAnchorOversize()
mComposerPicture->setSceneRect( QRectF( 70, 70, 150, 120 ) );
mComposerPicture->setPictureAnchor( QgsComposerItem::LowerMiddle );

QgsCompositionChecker checker( "expected_composerpicture_clip_anchoroversize", mComposition );
QgsCompositionChecker checker( "composerpicture_clip_anchoroversize", mComposition );
QVERIFY( checker.testComposition( mReport, 0, 0 ) );

mComposition->removeItem( mComposerPicture );

0 comments on commit 9329980

Please sign in to comment.