Fix remaining toAscii/fromAscii

Qt5 does not have toAscii or fromAscii.  Use toLatin1 and fromLatin1
respectively.  Both replacement functions exist in Qt4.8.
This commit is contained in:
maurerpe
2016-02-21 13:33:37 -05:00
committed by wmayer
parent 8fd08f9b43
commit 2e4efb5b10
10 changed files with 76 additions and 76 deletions

View File

@@ -111,13 +111,13 @@ bool QSvgIOHandlerPrivate::load(QIODevice *device)
loaded = true;
}
#else
webView.setContent(device->readAll(), QString::fromAscii("image/svg+xml"));
QString node = QString::fromAscii("document.rootElement.nodeName");
webView.setContent(device->readAll(), QString::fromLatin1("image/svg+xml"));
QString node = QString::fromLatin1("document.rootElement.nodeName");
QString root = webView.page()->mainFrame()->evaluateJavaScript(node).toString();
if (!root.isEmpty() && root.compare(QLatin1String("svg"), Qt::CaseInsensitive) == 0) {
QString w = QString::fromAscii("document.rootElement.width.baseVal.value");
QString h = QString::fromAscii("document.rootElement.height.baseVal.value");
QString w = QString::fromLatin1("document.rootElement.width.baseVal.value");
QString h = QString::fromLatin1("document.rootElement.height.baseVal.value");
double ww = webView.page()->mainFrame()->evaluateJavaScript(w).toDouble();
double hh = webView.page()->mainFrame()->evaluateJavaScript(h).toDouble();