execjosh 2012-02-05 10:46:31 +09:00
parent 9123e4b01f
commit 32b3e06ab4
1 changed files with 2 additions and 0 deletions

View File

@ -341,11 +341,13 @@ void WebPage::openUrl(const QString &address, const QVariant &op, const QVariant
} else {
QUrl url = QUrl::fromEncoded(QByteArray(address.toAscii()));
#if QT_VERSION == QT_VERSION_CHECK(4, 8, 0)
// Assume local file if scheme is empty
if (url.scheme().isEmpty()) {
url.setPath(QFileInfo(url.toString()).absoluteFilePath().prepend("/"));
url.setScheme("file");
}
#endif
m_mainFrame->load(QNetworkRequest(url), networkOp, body);
}