[QGIS Commit] r12421 - trunk/qgis/src/app/composer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Dec 12 12:12:03 EST 2009


Author: mhugent
Date: 2009-12-12 12:12:01 -0500 (Sat, 12 Dec 2009)
New Revision: 12421

Modified:
   trunk/qgis/src/app/composer/qgscomposer.cpp
Log:
Update composer previews if refresh button is clicked. Fix for bug #2207

Modified: trunk/qgis/src/app/composer/qgscomposer.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposer.cpp	2009-12-12 13:20:30 UTC (rev 12420)
+++ trunk/qgis/src/app/composer/qgscomposer.cpp	2009-12-12 17:12:01 UTC (rev 12421)
@@ -433,10 +433,24 @@
 
 void QgsComposer::on_mActionRefreshView_triggered()
 {
-  if ( mComposition )
+  if ( !mComposition )
   {
-    mComposition->update();
+    return;
   }
+
+  //refresh preview of all composer maps
+  QMap<QgsComposerItem*, QWidget*>::iterator it = mItemWidgetMap.begin();
+  for(; it != mItemWidgetMap.end(); ++it)
+  {
+    QgsComposerMap* map = dynamic_cast<QgsComposerMap*>(it.key());
+    if(map && !map->isDrawing())
+    {
+      map->cache();
+      map->update();
+    }
+  }
+
+  mComposition->update();
 }
 
 void QgsComposer::on_mActionExportAsPDF_triggered()



More information about the QGIS-commit mailing list