Can't load Image source in QML Image

I suppose that your qml file is in resources, so try place your testImage.png image in resources too. Recompile app, run it and check is image works properly.

All should be together. For example:

enter image description here

My code:

Image
{
    source: "images/earth.png"

If I delete this image from resources, I'll get this error too, but image still in the correct place in file system.

When qml source placed in the resource, then all files, which loads from qml should be in resource too (Qt searchs this files in the resources, not in the file system).


If you are locating from local filesystem , get the file path and prefix "file:" as source = "file:/root/Desktop/Rathod.png"

Tags:

Image

Qt

Qml