diff options
author | Michal Klocek <michal.klocek@qt.io> | 2023-03-15 16:12:43 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-03-20 16:32:42 +0000 |
commit | 33fac9305d4a542b389d0d06ec07f05fd9699db2 (patch) | |
tree | d09aa8bf40beb8c33a21ccab03fee5a28afec8b9 /src | |
parent | b4549ec0120ecce12ddf1fe55b02e668d216e1ba (diff) | |
download | qtwebengine-33fac9305d4a542b389d0d06ec07f05fd9699db2.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.
Pick-to: 6.5
Fixes: QTBUG-87275
Change-Id: I1046f57f61346a2cbc03f50ca453209a855ea561
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src')
-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)); } /*! |