[QGIS Commit] r11817 - in trunk/qgis/src: app/composer core core/composer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Oct 16 04:37:39 EDT 2009


Author: mhugent
Date: 2009-10-16 04:37:38 -0400 (Fri, 16 Oct 2009)
New Revision: 11817

Modified:
   trunk/qgis/src/app/composer/qgscomposer.cpp
   trunk/qgis/src/app/composer/qgscompositionwidget.h
   trunk/qgis/src/core/CMakeLists.txt
   trunk/qgis/src/core/composer/qgscomposition.cpp
   trunk/qgis/src/core/composer/qgscomposition.h
Log:
Update composition item with signal in case the paper size has been changed

Modified: trunk/qgis/src/app/composer/qgscomposer.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposer.cpp	2009-10-15 23:22:44 UTC (rev 11816)
+++ trunk/qgis/src/app/composer/qgscomposer.cpp	2009-10-16 08:37:38 UTC (rev 11817)
@@ -181,6 +181,7 @@
   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 @@
 
   //create compositionwidget
   QgsCompositionWidget* compositionWidget = new QgsCompositionWidget( mCompositionOptionsFrame, mComposition );
+  QObject::connect( mComposition, SIGNAL( paperSizeChanged() ), compositionWidget, SLOT( displayCompositionWidthHeight() ) );
   compositionWidget->show();
 
   mCompositionOptionsLayout = new QGridLayout( mCompositionOptionsFrame );

Modified: trunk/qgis/src/app/composer/qgscompositionwidget.h
===================================================================
--- trunk/qgis/src/app/composer/qgscompositionwidget.h	2009-10-15 23:22:44 UTC (rev 11816)
+++ trunk/qgis/src/app/composer/qgscompositionwidget.h	2009-10-16 08:37:38 UTC (rev 11817)
@@ -55,6 +55,8 @@
     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 @@
     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();
 

Modified: trunk/qgis/src/core/CMakeLists.txt
===================================================================
--- trunk/qgis/src/core/CMakeLists.txt	2009-10-15 23:22:44 UTC (rev 11816)
+++ trunk/qgis/src/core/CMakeLists.txt	2009-10-16 08:37:38 UTC (rev 11817)
@@ -181,6 +181,7 @@
 composer/qgscomposerpicture.h
 composer/qgscomposerscalebar.h
 composer/qgscomposeritemgroup.h
+composer/qgscomposition.h
 composer/qgslegendmodel.h
 symbology/qgsmarkercatalogue.h
 raster/qgsrasterlayer.h

Modified: trunk/qgis/src/core/composer/qgscomposition.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposition.cpp	2009-10-15 23:22:44 UTC (rev 11816)
+++ trunk/qgis/src/core/composer/qgscomposition.cpp	2009-10-16 08:37:38 UTC (rev 11817)
@@ -59,6 +59,7 @@
   if ( mPaperItem )
   {
     mPaperItem->setRect( QRectF( 0, 0, width, height ) );
+    emit paperSizeChanged();
   }
 }
 

Modified: trunk/qgis/src/core/composer/qgscomposition.h
===================================================================
--- trunk/qgis/src/core/composer/qgscomposition.h	2009-10-15 23:22:44 UTC (rev 11816)
+++ trunk/qgis/src/core/composer/qgscomposition.h	2009-10-16 08:37:38 UTC (rev 11817)
@@ -36,6 +36,7 @@
  * */
 class CORE_EXPORT QgsComposition: public QGraphicsScene
 {
+    Q_OBJECT
   public:
 
     /** \brief Plot type */
@@ -187,6 +188,9 @@
 
     void loadGridAppearanceSettings();
     void saveGridAppearanceSettings();
+
+  signals:
+    void paperSizeChanged();
 };
 
 #endif



More information about the QGIS-commit mailing list