diff options
author | Michal Klocek <michal.klocek@qt.io> | 2023-03-15 16:12:43 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-03-21 07:36:04 +0000 |
commit | 8d30a94e6315602119c22d5d21d571e98fe7e254 (patch) | |
tree | 2812576b7cffc509e54d454b809817209d7a5493 | |
parent | c9a9c55dcc51f0333258acd0e4d5bc04d7c77933 (diff) | |
download | qtwebengine-8d30a94e6315602119c22d5d21d571e98fe7e254.tar.gz |
QtPdf: Support more schemas when loading documents with qml
This is follow up after efbb12954cf6e58, use same handling as for
reloading on password change.
Fixes: QTBUG-87275
Change-Id: I1046f57f61346a2cbc03f50ca453209a855ea561
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 33fac9305d4a542b389d0d06ec07f05fd9699db2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/pdfquick/qquickpdfdocument.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/pdfquick/qquickpdfdocument.cpp b/src/pdfquick/qquickpdfdocument.cpp index 5564a7474..492c320d6 100644 --- a/src/pdfquick/qquickpdfdocument.cpp +++ b/src/pdfquick/qquickpdfdocument.cpp @@ -74,10 +74,8 @@ void QQuickPdfDocument::setSource(QUrl source) emit sourceChanged(); const QQmlContext *context = qmlContext(this); m_resolvedSource = context ? context->resolvedUrl(source) : source; - if (source.scheme() == QLatin1String("qrc")) - m_doc->load(QLatin1Char(':') + m_resolvedSource.path()); - else - m_doc->load(m_resolvedSource.toLocalFile()); + if (m_resolvedSource.isValid()) + m_doc->load(QQmlFile::urlToLocalFileOrQrc(m_resolvedSource)); } /*! |