Cannot load pdf in the app works only for the single file
Unsolved
QML and Qt Quick
-
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? -
Looks like a bug. Which version of Qt are you using?
-
Did it work in earlier versions of Qt?
-
@Axel-Spoerl
Should I open a bug or something? -
Yeah, report a bug, please.
-
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
.