Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Loading image with Qmlscene
Hi all, I don't understand why when I try to run a simple qml file with the qml scene tool , I have the message "cannot open file://..."
but when I run the c++ code loading the qml with the Qml Application Engine, everything is oK.
Is it impossible to display images with the qml scene ?
Thank you in advance for your answer.
Are you sure the paths are correct? Do you run qmlscene and your app from the same working directory?
I run qmlscene from c:\Qt\5.11.3\mingw53\bin
my working directory is in C:\REPO\test\build-test_qmlscene-Desktop_Qt_5_11_3_MinGW_32bit-Debug
Which path do I have to change ?
Run qmlscene from C:\REPO\test\build-test_qmlscene-Desktop_Qt_5_11_3_MinGW_32bit-Debug, same as you run your app. Or add that folder to QML import path using
-Iflag. More info: https://doc.qt.io/qt-5/qtquick-qmlscene.html
That is assuming that you are using relative paths to load QML. If you're using QRC qmlscene won't work.
I have added import ' . ' at th beginning of the qml file and now it works !
@sierdzio thank you for your help