Commit 56607655 authored by Volker Krause's avatar Volker Krause
Browse files

Fix reading SVG aspect ratios from qrc: URLs

parent ec141c75
......@@ -15,6 +15,7 @@
#include <QDateTime>
#include <QFile>
#include <QTimeZone>
#include <QUrl>
#include <QXmlStreamReader>
#include <cmath>
......@@ -85,9 +86,13 @@ float Util::svgAspectRatio(const QString &svgFilePath) const
return 1.0f;
}
QFile file(svgFilePath);
QString localFilePath(svgFilePath);
if (svgFilePath.startsWith(QLatin1String("qrc:"))) {
localFilePath = QLatin1Char(':') + QUrl(svgFilePath).path();
}
QFile file(localFilePath);
if (!file.open(QFile::ReadOnly)) {
qCWarning(Log) << file.errorString() << svgFilePath;
qCWarning(Log) << file.errorString() << localFilePath;
return 1.0f;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment