Skip to content
Permalink
Browse files

Fix segfault when html composer labels contain img tags

  • Loading branch information
nyalldawson committed Apr 19, 2013
1 parent 007e237 commit 032b4ad6947eed5273d666a0fe764922c501992a
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/core/composer/qgscomposerlabel.cpp
@@ -81,6 +81,15 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem*
webPage->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
webPage->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );

// QGIS segfaults when rendering web page while in composer if html
// contains images. So if we are not printing the composition, then
// disable image loading
if ( mComposition->plotStyle() != QgsComposition::Print &&
mComposition->plotStyle() != QgsComposition::Postscript )
{
webPage->settings()->setAttribute( QWebSettings::AutoLoadImages, false );
}

//Connect timeout and webpage loadFinished signals to loop
connect( &timeoutTimer, SIGNAL( timeout() ), &loop, SLOT( quit() ) );
connect( webPage, SIGNAL( loadFinished( bool ) ), &loop, SLOT( quit() ) );

0 comments on commit 032b4ad

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