[QGIS Commit] r15771 - trunk/qgis/src/gui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Apr 19 15:23:07 EDT 2011


Author: mhugent
Date: 2011-04-19 12:23:07 -0700 (Tue, 19 Apr 2011)
New Revision: 15771

Modified:
   trunk/qgis/src/gui/qgsmapcanvas.cpp
Log:
Fix for resize crash, ticket #2714

Modified: trunk/qgis/src/gui/qgsmapcanvas.cpp
===================================================================
--- trunk/qgis/src/gui/qgsmapcanvas.cpp	2011-04-19 15:12:47 UTC (rev 15770)
+++ trunk/qgis/src/gui/qgsmapcanvas.cpp	2011-04-19 19:23:07 UTC (rev 15771)
@@ -83,6 +83,12 @@
     , mNewSize( QSize() )
     , mPainting( false )
 {
+  //disable the update that leads to the resize crash
+  if( viewport() )
+  {
+    viewport()->setAttribute( Qt::WA_PaintOnScreen, true );
+  }
+
   mScene = new QGraphicsScene();
   setScene( mScene );
   setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
@@ -122,7 +128,7 @@
            this, SLOT( readProject( const QDomDocument & ) ) );
   connect( QgsProject::instance(), SIGNAL( writeProject( QDomDocument & ) ),
            this, SLOT( writeProject( QDomDocument & ) ) );
-
+  mMap->resize( size() );
 } // QgsMapCanvas ctor
 
 



More information about the QGIS-commit mailing list