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

[SOLVED]Image doesn't appear while running from qt creator



  • Hi,

    I am new with qml. I created a Qt Quick Application and created ui part.

    Code is:

    @import QtQuick 2.0

    Rectangle {
    width: 200; height: 200
    Image {
    id: image
    source: "../images/sample64.png"
    }
    }
    @

    The project when I run from the qt creator the screen appears blank (just a white screen).

    But if I open the qml file with qmlviewer, the image appears.

    Why is it so? what should I do to see the image while debugging the project?



  • You should see an error message in the application output screen. It should tell you where it looks for the image.



  • To Eddy,

    The relative path was the issue.

    Thanks



  • great you solved it.

    could you please edit the title of your first post and add [solved] to it?


Log in to reply