Cannot load pdf in the app works only for the single file
-
wrote on 2 Nov 2024, 19:32 last edited by
This is the single file:
import QtQuick import QtQuick.Pdf PdfScrollablePageView { id: pdfPage document: PdfDocument { id: doc source: "/home/user/.local/share/org/app/data/Model1/file.pdf" onSourceChanged: { console.log('DOC.SOURCE CHANGED' + doc.source) } } onStatusChanged: { console.log('Status changed ' + status) } Component.onCompleted: { console.log('OnCompleted status ' + status) console.log('OnCompleted DOC.SOURCE ' + doc.source) } }
This the log when I run the app:
qml: OnCompleted status 0 qml: OnCompleted DOC.SOURCE /home/user/.local/share/org/app/data/Model1/file.pdf
This when I run only that file wiht
qml6 file.qml
:qml: Status changed 2 qml: OnCompleted status 2 qml: OnCompleted DOC.SOURCE /home/user/.local/share/org/app/data/Model1/file.pdf qml: Status changed 1
I think that status 0 is the first of https://doc.qt.io/qt-6/qml-qtquick-image.html#status-prop so
No image has been set
.
I tried to set it after inComponent.onCompleted
and some things but when I run the app status is 0 and does not change.
How fix it? -
wrote on 11 Feb 2025, 11:00 last edited by
That means error so nothing is displayed.
https://doc.qt.io/qt-6/qml-qtquick-image.html#status-propIf I use
source: StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/qtpdfbug/qtlogo.pdf"
It works.
While this works only if I use
qml6
with file and not when I launch the app.source: "/home/user/qtpdfbug/qtlogo.pdf"
Using this always work
source: "file:///home/user/qtpdfbug/qtlogo.pdf"
-
Looks like a bug. Which version of Qt are you using?
-
wrote on 4 Nov 2024, 07:17 last edited by realroot 11 Apr 2024, 07:24
qml6 -v Qml Runtime 6.8.0 qt6-base 6.8.0-1 qt6-declarative 6.8.0-2.2
-
Did it work in earlier versions of Qt?
-
wrote on 5 Nov 2024, 15:13 last edited by
No, note that it's the first time that I am trying this so it could be possible.
-
wrote on 1 Dec 2024, 20:21 last edited by
@Axel-Spoerl
Should I open a bug or something? -
Yeah, report a bug, please.
-
wrote on 10 Feb 2025, 15:48 last edited by realroot 2 Oct 2025, 15:49
I made a minimal app to test this that can be used in Qt Creator.
https://send.trom.tf/f.php?h=2oDBNgjD&d=1&k=9971ab3cdf02f0eccc0869282e76a147Running
qml6 Main.qml
works but running the app has
status 0
. -
I made a minimal app to test this that can be used in Qt Creator.
https://send.trom.tf/f.php?h=2oDBNgjD&d=1&k=9971ab3cdf02f0eccc0869282e76a147Running
qml6 Main.qml
works but running the app has
status 0
.@realroot said in Cannot load pdf in the app works only for the single file:
but running the app has status 0
What is the problem with that?
-
wrote on 11 Feb 2025, 11:00 last edited by
That means error so nothing is displayed.
https://doc.qt.io/qt-6/qml-qtquick-image.html#status-propIf I use
source: StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/qtpdfbug/qtlogo.pdf"
It works.
While this works only if I use
qml6
with file and not when I launch the app.source: "/home/user/qtpdfbug/qtlogo.pdf"
Using this always work
source: "file:///home/user/qtpdfbug/qtlogo.pdf"
-