Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Quick cross compiled application didn't show images on raspberry pi 4



  • I cross compiled Qt5.14.2 for my raspberry pi 4 on a raspberry pi OS lite

    after that I created a Qt Quick application on my Ubuntu and I integrated images in my qml file

    Image {
            id: compteur
            x: 223
            y: 102
            width: 570
            height: 227
            source: "images/b2.png"
        }
    

    so the image b2.png on my ubuntu is under ~/Desktop/test_v1/images and the executable test_v1 was generated under ~/Desktop/build-test_v1-Qt5pi-Release

    on my raspberry pi I copied this executable and copied also all the directory test_v1

    but when executing the application it worked well but the images didn't show up

    I tried also to put the images and the executable in the same directory but couldn't work also.

    if you know what should I change please tell me !

    Thank you in advance



  • @amina

    Did you consider using Qt resources?

    Otherwise you should be able to to remote debug the application from a desktop. This should give you some error messages with a clue what is happening.



  • @amina

    Did you consider using Qt resources?

    Otherwise you should be able to to remote debug the application from a desktop. This should give you some error messages with a clue what is happening.



  • Thank you , I didn't know about the Qt resources , I will try it and keep you updated.

    and for the remote debug , I couldn't do it because I cross compiled Qt for a lite version .. even eglfs is not available. when I want to test something I just execute it on the raspberry with the framebuffer linuxfb



  • @koahnig Thank you so much, it works now with the Qt ressources.

    I will post what I did maybe it will help someone!

    so under my test_v1 directory I createad a file image.qrc (I used nano to create it)
    after that in qtcreator I added to my project this file (right click on the project -> add existing files-> choose image.qrc)

    image.qrc containes :

    <!DOCTYPE RCC> <RCC version="1.0">
    <qresource>
        <file>images/b2.png</file>
    </qresource>
     </RCC>
    

    the image b2.png is under test_v1/images


Log in to reply