Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to load in a docked QWebView this html:

    < html >
< body >
< iframe width="100%" height="499" frameborder="0" 
scrolling="no" marginheight="0" 
src="" >
< /iframe >
< /body >< /html >

I'm using this code:

class WebView(QWebView):
def __init__(self, parent=None,framed=False):
    QWebView.__init__(self, parent)
    #QObject.connect(self, SIGNAL("loadFinished(bool)"), self.onLoad)
    #QObject.connect(, SIGNAL("sslErrors(QNetworkReply *, const QList<QSslError> &)"), self.onErrors)
    self.settings().setAttribute(QWebSettings.PluginsEnabled, True)
    self.framed = framed

def load(self,url, params):
    mqurl = QUrl.fromUserInput(QString.fromAscii(url))
    p = []
    QgsMessageLog.logMessage("url="+url, "WebView")
    for k, v in params.iteritems():
        p.append( (k, v) )
        QgsMessageLog.logMessage(str(k)+'=' + str(v), "WebView")

    if self.framed==True:
        qmhtml = QString.fromAscii(mhtml)

If framed is False it works, if framed is True the webpage is not loaded. With other webpages it works. Is it due to Ajax? How to solve this? Thanks

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.