summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiika Pernu <miika.pernu@qt.io>2020-11-27 11:56:11 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-12-01 17:06:43 +0000
commit97d8dc52b497c5202742280bfd2cf5fa54eb0302 (patch)
treeb0fc3b7bf1469a61ee1f4a96a7afdf59bd5dd1c7
parent518cb95730dd1ac889cbe732fab11019085a5cd8 (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 Change-Id: I52ed44f67c22bea31637050442487e1914011de9 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 5852716178972dd34df34dabc52a6616eead0aca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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());
}
/*!