Skip to content
Permalink
Browse files

Update composition item with signal in case the paper size has been c…

…hanged

git-svn-id: http://svn.osgeo.org/qgis/trunk@11817 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Oct 16, 2009
1 parent 4817ab2 commit 505a0c1efbb5b64b5569e2701f506ffc5f811b9c
@@ -181,6 +181,7 @@ QgsComposer::QgsComposer( QgisApp *qgis ): QMainWindow(), mFirstPaint( true )
mView->setComposition( mComposition );

QgsCompositionWidget* compositionWidget = new QgsCompositionWidget( mCompositionOptionsFrame, mComposition );
QObject::connect( mComposition, SIGNAL( paperSizeChanged() ), compositionWidget, SLOT( displayCompositionWidthHeight() ) );
compositionWidget->show();

mCompositionOptionsLayout = new QGridLayout( mCompositionOptionsFrame );
@@ -1097,6 +1098,7 @@ void QgsComposer::readXML( const QDomDocument& doc )

//create compositionwidget
QgsCompositionWidget* compositionWidget = new QgsCompositionWidget( mCompositionOptionsFrame, mComposition );
QObject::connect( mComposition, SIGNAL( paperSizeChanged() ), compositionWidget, SLOT( displayCompositionWidthHeight() ) );
compositionWidget->show();

mCompositionOptionsLayout = new QGridLayout( mCompositionOptionsFrame );
@@ -55,6 +55,8 @@ class QgsCompositionWidget: public QWidget, private Ui::QgsCompositionWidgetBase
void on_mGridColorButton_clicked();
void on_mGridStyleComboBox_currentIndexChanged( const QString& text );
void on_mPenWidthSpinBox_valueChanged( double d );
/**Sets GUI elements to width/height from composition*/
void displayCompositionWidthHeight();

private:
QgsComposition* mComposition;
@@ -67,8 +69,6 @@ class QgsCompositionWidget: public QWidget, private Ui::QgsCompositionWidgetBase
void applyWidthHeight();
/**Makes sure width/height values for custom paper matches the current orientation*/
void adjustOrientation();
/**Sets GUI elements to width/height from composition*/
void displayCompositionWidthHeight();
/**Sets GUI elements to snaping distances of composition*/
void displaySnapingSettings();

@@ -181,6 +181,7 @@ composer/qgscomposermap.h
composer/qgscomposerpicture.h
composer/qgscomposerscalebar.h
composer/qgscomposeritemgroup.h
composer/qgscomposition.h
composer/qgslegendmodel.h
symbology/qgsmarkercatalogue.h
raster/qgsrasterlayer.h
@@ -59,6 +59,7 @@ void QgsComposition::setPaperSize( double width, double height )
if ( mPaperItem )
{
mPaperItem->setRect( QRectF( 0, 0, width, height ) );
emit paperSizeChanged();
}
}

@@ -36,6 +36,7 @@ class QDomElement;
* */
class CORE_EXPORT QgsComposition: public QGraphicsScene
{
Q_OBJECT
public:

/** \brief Plot type */
@@ -187,6 +188,9 @@ class CORE_EXPORT QgsComposition: public QGraphicsScene

void loadGridAppearanceSettings();
void saveGridAppearanceSettings();

signals:
void paperSizeChanged();
};

#endif

0 comments on commit 505a0c1

Please sign in to comment.
You can’t perform that action at this time.