Nominate our 2022 Qt Champions!

[SOLVED]Working With Files in Mobile Apps

  • Hi!

    I have a simple question , but it´s being hard for me understand where Qt and how i can setup my App to work with
    files, for example:

    I have a specific folder in my aplication called "world" , and Inside of this folder i have all the shaders, textures , scripts and etc...used by my aplication.

    This works fine for PC , Mac and Linux, but i dont know yet how i can setup this to be loaded properly by my aplication, for example:

    I use this line of code to load a shader in my aplication:


    But when i run it in Android the application not find it...

    How can i setup a folder containing files to be load at runtime in android?

    Kind Regards.

  • Lifetime Qt Champion


    You have several possibilities: qrc or assets. Unless your files are big using Qt's resources system will simplify deployment since they are built-in your application.

    Hope it helps

  • Hi SGaist,

    I try use qrc on the aplication and it fits perfectly with my needs and a Lot More!

    Amazing, this solve the problem since i have now the same folter for all platforms and being accessed at the same manner in the code.


    Since i will distribute the files with the software, now i dont need code a lot of stuff to mantain compatibility between the different plafforms...really Cool!

    Thanks so much for your help!

    Kind Regards.

Log in to reply