Skip to content
Permalink
Browse files

[composer] Use a transparent background for HTML items

  • Loading branch information
nyalldawson committed Sep 22, 2014
1 parent 1cb328c commit b9e65b4131b2bb815c5ca0958ceca91a466763aa
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/composer/qgscomposerhtml.cpp
@@ -47,6 +47,12 @@ QgsComposerHtml::QgsComposerHtml( QgsComposition* c, bool createUndoCommands ):
mWebPage = new QWebPage();
mWebPage->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
mWebPage->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );

//This makes the background transparent. Found on http://blog.qt.digia.com/blog/2009/06/30/transparent-qwebview-or-qwebpage/
QPalette palette = mWebPage->palette();
palette.setBrush( QPalette::Base, Qt::transparent );
mWebPage->setPalette( palette );

mWebPage->setNetworkAccessManager( QgsNetworkAccessManager::instance() );
QObject::connect( mWebPage, SIGNAL( loadFinished( bool ) ), this, SLOT( frameLoaded( bool ) ) );
if ( mComposition )

0 comments on commit b9e65b4

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