[Qt-interest] Embed pixmaps at runtime

Frank Hemer frank at hemer.org
Mon Feb 16 03:29:13 CET 2009


On Sunday 15 February 2009 18:51:36 Constantin Makshin wrote:
> Qt resources are embedded right into the code of the application, so you
> can't easily add Qt resources at runtime. Even if you could, it's likely
> that your application won't have permissions to modify its executable file.
>
> P.S.: And rcc has nothing to do with the application's executable. It only
> generates a C++ header file with all required information about embedded
> files. Final "embedding" is done by the compiler.

Hmm - no, rcc allows for compiling a resource into a binary format that can be 
loaded at runtime. Still - except for running rcc via QProcess and adding the 
resource via QResource::registerResource (...) - there is currently no way to 
achive a runtime resource extension.
You might take a look at the rcc source - and maybe include parts of it into 
your application but beware of future changes ...

Btw. there is still a feature request pending on this issue.

Frank

> On Sun, 15 Feb 2009 17:49:44 +0300, Nadia Pio <nadiapio at gmail.com> wrote:
> > Hello everybody,
> > in my application I use some icons that are embedded into the
> > application's executable through the Qt Resource System.
> > At runtime the user can import from the file system other icons and
> > I'd like to add them dynamically (at runtime) to the resource file and
> > embed them in the application. Is there a way to do this?
> > I know that I can register external binary resources, but I need to
> > create the resource data before to register them; is there a way to
> > run the rcc at runtime?
> > Thank you.
> > Nadia





More information about the Qt-interest-old mailing list