Skip to content

Commit

Permalink
assign network access manager to QWebPages (fixes #10189)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 6, 2014
1 parent 90f0721 commit 4efa70d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/core/composer/qgscomposerhtml.cpp
Expand Up @@ -17,6 +17,8 @@
#include "qgscomposerframe.h"
#include "qgscomposition.h"
#include "qgsaddremovemultiframecommand.h"
#include "qgsnetworkaccessmanager.h"

#include <QCoreApplication>
#include <QPainter>
#include <QWebFrame>
Expand All @@ -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 )
{
Expand Down
5 changes: 4 additions & 1 deletion src/core/composer/qgscomposerlabel.cpp
Expand Up @@ -18,6 +18,8 @@
#include "qgscomposerlabel.h"
#include "qgscomposition.h"
#include "qgsexpression.h"
#include "qgsnetworkaccessmanager.h"

#include <QCoreApplication>
#include <QDate>
#include <QDomElement>
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/gui/qgshtmlannotationitem.cpp
Expand Up @@ -24,6 +24,7 @@
#include "qgsmaptool.h"
#include "qgsvectorlayer.h"
#include "qgsexpression.h"
#include "qgsnetworkaccessmanager.h"

#include <QDomElement>
#include <QDir>
Expand All @@ -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 );

Expand Down

0 comments on commit 4efa70d

Please sign in to comment.