Bladeren bron

Allow references to external resources positioned relative to the configuration

Neal Wilson 10 jaren geleden
bovenliggende
commit
89b5b7d444
1 gewijzigde bestanden met toevoegingen van 4 en 1 verwijderingen
  1. 4
    1
      src/webview.w

+ 4
- 1
src/webview.w Bestand weergeven

@@ -20,6 +20,7 @@ In order to simplify the implementation of certain features, we subclass
20 20
 #include <QPrintDialog>
21 21
 #include <QWebFrame>
22 22
 #include <QWebElement>
23
+#include <QSettings>
23 24
 
24 25
 #ifndef TypicaWebViewHeader
25 26
 #define TypicaWebViewHeader
@@ -131,9 +132,11 @@ void TypicaWebView::setHtml(const QString &html, const QUrl &baseUrl)
131 132
 
132 133
 void TypicaWebView::setContent(QIODevice *device)
133 134
 {
135
+	QSettings settings;
134 136
 	device->reset();
135 137
 	QByteArray content = device->readAll();
136
-	QWebView::setContent(content, "application/xhtml+xml");
138
+	QUrl baseDir = QUrl("file://" + settings.value("config").toString() + "/");
139
+	QWebView::setContent(content, "application/xhtml+xml", baseDir);
137 140
 }
138 141
 
139 142
 QString TypicaWebView::saveXml()

Laden…
Annuleren
Opslaan