PDA

View Full Version : A problom about use qt Resource as independ dll



gephen
25th November 2009, 04:34
hi,
I want put all my application images in a qt plugin dll(all images as qt resource in the dll), how can i use these images which store in the all all after load the images dll as a qt plugin in other qt application. i.g Is there qt4 has api can load image resouce for a dll?
Thanks in advance.

fullmetalcoder
13th December 2009, 12:17
I think the easiest way to do that is add a load function to your DLL (exported of course and preferably available as C symbol) in which you'd place the proper Q_INIT_RESOURCE macro(s) and then call that function from your program using QLibrary.

If, as your post suggests, the plugin uses Qt plugin API the loading could (and for simplicity's sake should) be done in a method of the plugin class.