summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiika Pernu <miika.pernu@qt.io>2020-11-27 11:56:11 +0200
committerMiika Pernu <miika.pernu@qt.io>2020-12-01 14:36:30 +0200
commit5852716178972dd34df34dabc52a6616eead0aca (patch)
tree038aff12bb4b2e7e167a5d18677495df8ba9086b /src
parentc636e88bc49f59548e1ac3401ae547e2ae9d2570 (diff)
QtPdf: Fix for loading local .pdf files on Windows
QQuickPdfDocument passed source QUrl::path() to QPdfDocument::load. QUrl::path() output gets "/" as prefix on Windows preventing the file from being found so this needs to be accounted for by changing it to QUrl::toLocalFile(). Fixes: QTBUG-88938 Pick-to: 5.15 Change-Id: I52ed44f67c22bea31637050442487e1914011de9 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/pdf/quick/qquickpdfdocument.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pdf/quick/qquickpdfdocument.cpp b/src/pdf/quick/qquickpdfdocument.cpp
index ab5910523..79b23ca84 100644
--- a/src/pdf/quick/qquickpdfdocument.cpp
+++ b/src/pdf/quick/qquickpdfdocument.cpp
@@ -94,7 +94,7 @@ void QQuickPdfDocument::setSource(QUrl source)
if (source.scheme() == QLatin1String("qrc"))
m_doc.load(QLatin1Char(':') + source.path());
else
- m_doc.load(source.path());
+ m_doc.load(source.toLocalFile());
}
/*!