Browse Source

Allow references to external resources positioned relative to the configuration

Neal Wilson 10 years ago
parent
commit
89b5b7d444
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      src/webview.w

+ 4
- 1
src/webview.w View File

20
 #include <QPrintDialog>
20
 #include <QPrintDialog>
21
 #include <QWebFrame>
21
 #include <QWebFrame>
22
 #include <QWebElement>
22
 #include <QWebElement>
23
+#include <QSettings>
23
 
24
 
24
 #ifndef TypicaWebViewHeader
25
 #ifndef TypicaWebViewHeader
25
 #define TypicaWebViewHeader
26
 #define TypicaWebViewHeader
131
 
132
 
132
 void TypicaWebView::setContent(QIODevice *device)
133
 void TypicaWebView::setContent(QIODevice *device)
133
 {
134
 {
135
+	QSettings settings;
134
 	device->reset();
136
 	device->reset();
135
 	QByteArray content = device->readAll();
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
 QString TypicaWebView::saveXml()
142
 QString TypicaWebView::saveXml()

Loading…
Cancel
Save