Skip to content

Commit d79b12b

Browse files
committedDec 29, 2013
[composer] Make sure rulers are updated when paper size changes
1 parent 097a195 commit d79b12b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
 

‎src/app/composer/qgscomposer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,10 @@ void QgsComposer::connectSlots()
565565
connect( mComposition, SIGNAL( composerShapeAdded( QgsComposerShape* ) ), this, SLOT( addComposerShape( QgsComposerShape* ) ) );
566566
connect( mComposition, SIGNAL( composerTableAdded( QgsComposerAttributeTable* ) ), this, SLOT( addComposerTable( QgsComposerAttributeTable* ) ) );
567567
connect( mComposition, SIGNAL( itemRemoved( QgsComposerItem* ) ), this, SLOT( deleteItem( QgsComposerItem* ) ) );
568+
connect( mComposition, SIGNAL( paperSizeChanged() ), mHorizontalRuler, SLOT( update() ) );
569+
connect( mComposition, SIGNAL( paperSizeChanged() ), mVerticalRuler, SLOT( update() ) );
570+
connect( mComposition, SIGNAL( nPagesChanged() ), mHorizontalRuler, SLOT( update() ) );
571+
connect( mComposition, SIGNAL( nPagesChanged() ), mVerticalRuler, SLOT( update() ) );
568572

569573
//listen out for position updates from the QgsComposerView
570574
connect( mView, SIGNAL( cursorPosChanged( QPointF ) ), this, SLOT( updateStatusCursorPos( QPointF ) ) );

‎src/core/composer/qgscomposition.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ void QgsComposition::setPaperSize( double width, double height )
155155
mPages.at( i )->setSceneRect( QRectF( 0, currentY, width, height ) );
156156
currentY += ( height + mSpaceBetweenPages );
157157
}
158+
emit paperSizeChanged();
158159
}
159160

160161
double QgsComposition::paperHeight() const

0 commit comments

Comments
 (0)
Please sign in to comment.