Skip to content

Commit 94a547e

Browse files
committed
[composer] Update number of pages in gui whenever number of pages is changed by multi frame items (sponsored by City of Uster, Switzerland)
1 parent 8b9c9c4 commit 94a547e

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎src/app/composer/qgscompositionwidget.cpp‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ QgsCompositionWidget::QgsCompositionWidget( QWidget* parent, QgsComposition* c )
4747
if ( mComposition )
4848
{
4949
mNumPagesSpinBox->setValue( mComposition->numPages() );
50+
connect( mComposition, SIGNAL( nPagesChanged() ), this, SLOT( setNumberPages() ) );
5051

5152
updatePageStyle();
5253

@@ -431,6 +432,18 @@ void QgsCompositionWidget::setPrintAsRasterCheckBox( bool state )
431432
mPrintAsRasterCheckBox->blockSignals( false );
432433
}
433434

435+
void QgsCompositionWidget::setNumberPages()
436+
{
437+
if ( !mComposition )
438+
{
439+
return;
440+
}
441+
442+
mNumPagesSpinBox->blockSignals( true );
443+
mNumPagesSpinBox->setValue( mComposition->numPages() );
444+
mNumPagesSpinBox->blockSignals( false );
445+
}
446+
434447
void QgsCompositionWidget::displaySnapingSettings()
435448
{
436449
if ( !mComposition )

‎src/app/composer/qgscompositionwidget.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class QgsCompositionWidget: public QWidget, private Ui::QgsCompositionWidgetBase
6464
void displayCompositionWidthHeight();
6565
/**Sets Print as raster checkbox value*/
6666
void setPrintAsRasterCheckBox( bool state );
67+
/**Sets number of pages spin box value*/
68+
void setNumberPages();
6769

6870
signals:
6971
/**Is emitted when page orientation changes*/

0 commit comments

Comments
 (0)