Skip to content

Commit b6eab61

Browse files
author
mhugent
committedApr 19, 2011
Fix for resize crash, ticket #2714
git-svn-id: http://svn.osgeo.org/qgis/trunk@15771 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 740fb5c commit b6eab61

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎src/gui/qgsmapcanvas.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
8383
, mNewSize( QSize() )
8484
, mPainting( false )
8585
{
86+
//disable the update that leads to the resize crash
87+
if( viewport() )
88+
{
89+
viewport()->setAttribute( Qt::WA_PaintOnScreen, true );
90+
}
91+
8692
mScene = new QGraphicsScene();
8793
setScene( mScene );
8894
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
@@ -122,7 +128,7 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
122128
this, SLOT( readProject( const QDomDocument & ) ) );
123129
connect( QgsProject::instance(), SIGNAL( writeProject( QDomDocument & ) ),
124130
this, SLOT( writeProject( QDomDocument & ) ) );
125-
131+
mMap->resize( size() );
126132
} // QgsMapCanvas ctor
127133

128134

0 commit comments

Comments
 (0)
Please sign in to comment.