c++ - How to package large data in a Qt Project? -


i'm working on qt project includes large data set (70mb+).

the data used library accesses them using data's path.

i know can use resources normally, since in memory objects, can't use them library.

so question is, how can package file or folder available @ installation/runtime access?

the resources available in process's memory, library used within process has access them well. use qresource class find out address , size of resource, , pass library.

if library can't take pointer , size data, insists on file, can use qresource, qtemporaryfile , qfile::copy dump data executable temporary file library has work with.

the library should have 2 ways of accepting data:

  1. in-process data: address + size. e.g.

    setdata(void * address, int size); 
  2. out-of-process data: file path + offset + size.

    setdata(const char * filepath, void * offset = 0, int size = -1); // size = -1 uses entire file 

this allow library to:

  1. use binary resources available in process's memory, whether come qresource, or winapi resources, or held in temporary buffers after being downloaded network, etc.

  2. use binary resources available in files, including qt , windows resources available @ offset executable file itself.


Comments