Skip to content
Permalink
Browse files

assign network access manager to QWebPages (fixes #10189)

  • Loading branch information
jef-n committed May 6, 2014
1 parent 90f0721 commit 4efa70d43348cc251d791eefb8c4470e2fdb7dee
@@ -17,6 +17,8 @@
#include "qgscomposerframe.h"
#include "qgscomposition.h"
#include "qgsaddremovemultiframecommand.h"
#include "qgsnetworkaccessmanager.h"

#include <QCoreApplication>
#include <QPainter>
#include <QWebFrame>
@@ -32,6 +34,7 @@ QgsComposerHtml::QgsComposerHtml( QgsComposition* c, bool createUndoCommands ):
{
mHtmlUnitsToMM = htmlUnitsToMM();
mWebPage = new QWebPage();
mWebPage->setNetworkAccessManager( QgsNetworkAccessManager::instance() );
QObject::connect( mWebPage, SIGNAL( loadFinished( bool ) ), this, SLOT( frameLoaded( bool ) ) );
if ( mComposition )
{
@@ -18,6 +18,8 @@
#include "qgscomposerlabel.h"
#include "qgscomposition.h"
#include "qgsexpression.h"
#include "qgsnetworkaccessmanager.h"

#include <QCoreApplication>
#include <QDate>
#include <QDomElement>
@@ -87,7 +89,8 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem*
{
painter->scale( 1.0 / mHtmlUnitsToMM / 10.0, 1.0 / mHtmlUnitsToMM / 10.0 );

QWebPage* webPage = new QWebPage();
QWebPage *webPage = new QWebPage();
webPage->setNetworkAccessManager( QgsNetworkAccessManager::instance() );

//Setup event loop and timeout for rendering html
QEventLoop loop;
@@ -24,6 +24,7 @@
#include "qgsmaptool.h"
#include "qgsvectorlayer.h"
#include "qgsexpression.h"
#include "qgsnetworkaccessmanager.h"

#include <QDomElement>
#include <QDir>
@@ -40,6 +41,8 @@ QgsHtmlAnnotationItem::QgsHtmlAnnotationItem( QgsMapCanvas* canvas, QgsVectorLay
mHasAssociatedFeature( hasFeature ), mFeatureId( feature )
{
mWebView = new QWebView();
mWebView->page()->setNetworkAccessManager( QgsNetworkAccessManager::instance() );

mWidgetContainer = new QGraphicsProxyWidget( this );
mWidgetContainer->setWidget( mWebView );

0 comments on commit 4efa70d

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