PDA

View Full Version : Resource file in a lib



Rodrigo
22nd June 2007, 15:21
Is it possible to relate a .qrc in a lib? if yes, how could I do that?

Best regards.

Rodrigo Amorim

high_flyer
22nd June 2007, 21:27
could you explan a bit more what do you mean?

Rodrigo
23rd June 2007, 00:23
Of course :)

I'm creating some plugins for my application, some of the plugins are creating new widgets, new tabs and so on.

those widget created by the plugins, there are some icons in it, i would like to put the icons in a resource file, but in this case i'm not doing an application, i'm doing a lib. I created a .qrc and i called it in my plugin, but it didn't work.

so, i'd like to know if there is a way to associate a .qrc file in my plugins (lib)


i'm sorry about my english! :)

Thank you in advance.

camel
23rd June 2007, 13:04
so, i'd like to know if there is a way to associate a .qrc file in my plugins (lib)


You do it the same way as you would in your app. (i.e. via the RESOURCES qmake variable).

But: read the the Resource System (http://doc.trolltech.com/4.3/resources.html) part of the Qt documentation; especially the last paragraph.
If there is a possibility that your library is getting linked statically, you must use Q_INIT_RESOURCE (http://doc.trolltech.com/4.3/qdir.html#Q_INIT_RESOURCE).

Rodrigo
25th June 2007, 15:22
I solved my problem, i forgot to put in the .qrc file the following line:

Resource += plugin

when i inserted that, it worked perfectly!

thanks