How to handle large Qt resource files on a system with a very slow storage?

Viewed 2474

An embedded system has the hardware required to run Qt Quick applications, has a nice CPU and good GPU, but has an extremely slow non-volatile memory.

As the GUI has a lot of images, I have the following dilemma:

  • if I put the images into a qrc file, it will be compiled into the executable, so the application will load very slowly.
  • if I load the images as normal files on-demand (not all of them are visible in every menu and dialog), the program will hang for a while whenever such a menu or dialog opens, waiting for the images to be loaded from flash memory.
  • Managing the individual images manually (for example, in a manually written background thread) seems like too much effort, so I hope there is a more elegant solution.

Is there a nice way to use the Qt resource management system to load the resources in the background? The images used in the main GUI should be loaded while a splash screen displays a nice progress bar, and the rest can be loaded silently in the background after the main application starts. A nice addition would be if I could selectively load and free up certain resource files (in some states of the application some resource files are not needed, so it would be nice if I could free up some memory)

Is there an elegant way to solve this with the Qt resource system, or do I have to manage all my images manually?

2 Answers
Related