[webkit-qt] setContent issues

Aris van Dijk arisvd at gmail.com
Wed Jun 2 05:51:36 PDT 2010


Hi,

I am trying to use setContent on QtWebFrame. It takes a data, content type,
and base URL argument. However, I have the following issues with this:

   1. setContent on the .mainFrame() of a page does not seem to emit
   loadFinished on the page. Is there any other signal that is being emitted?
   2. The base URL parameter does not work for me. I am trying to resolve a
   style sheet using a local base URL.

My example code:

    QString contentType("application/xhtml+xml"); //"text/html"
    QUrl baseUrl(QString("file:///D:/SomePathToMyApp/"));
    QByteArray data;
    data.append("<html>");
       data.append( "<head>");
            data.append("<meta http-equiv=\"Content-Type\"
content=\"text/html; charset=ISO-8859-1\" />");
            data.append("<link rel=\"stylesheet\" type=\"text/css\"
href=\"../stylesheets/style_common.css\"/>");
            data.append("<link rel=\"stylesheet\" type=\"text/css\"
href=\"../stylesheets/style.css\"/>");
        data.append("</head>");
        data.append("<body>");
            data.append("<div class=\"someDefinedCSSClass\">");
                data.append("Hello world!");
            data.append("</div>");
        data.append("</body>");
    data.append("</html>");
    m_page.mainFrame()->setContent(data, contentType, baseUrl);

I was trying to modify the webcapture tool (
http://qt.gitorious.org/qt-labs/graphics-dojo/trees/master/webcapture),
which uses the loadFinished signal on the page. I replaced one line:
    m_page.mainFrame()->load(url);
by the above test code, but after that the script didn't quit anymore.

Could someone help me with this?

Bye,

Aris van Dijk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20100602/d8c64789/attachment.html>


More information about the webkit-qt mailing list