Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>External URLs must have a schema to make them external, otherwise "external.org/script.js" looks for "script.js" under the "external.org/" sub-path, "http://external.org/script.js" is an absolute URL.</p> <p>Edit:<br> Say you have this HTML file as the resource ":/file.html" and it is coppied from "http://example.com/": </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;My HTML&lt;/title&gt; &lt;script type="text/javascript" src="/code.js"&gt;&lt;/scipt&gt; &lt;/head&gt; &lt;body&gt; &lt;img href="/image.jpg" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Then to display this correctly you would need to do the following:</p> <pre><code>QFile res(":/file.html"); res.open(QIODevice::ReadOnly|QIODevice::Text); my_webview.setHtml(res.readAll(), QUrl("http://example.com/"); </code></pre> <p>That way, WebKit knows where to fetch "code.js" and "image.jpg" from. Using <code>QWebView::load()</code> will not work, as the root URL will be some internal URL, the one starting with qrc://, and WebKit will look for "code.js" and "image.jpg" in your applications resources. Basically, you can only use <code>load()</code> when all the relative URLs in the document come from the same place as the URL is pointing to. And if you used <code>load(QUrl("qrc:///file.html"));</code> in the case above, the URL (<code>qrc:///file.html</code>) is pointing to your resource system.</p> <p>If you want to also include your resources in the HTML, you can use the qrc:// URLs in the HTML file.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload