[Qt-interest] Linux shared library can not load Qt resources? Resource initialization problem ?
Ed Sutton
ESutton at fescorp.com
Tue Nov 30 23:18:34 CET 2010
On Nov 30, 2010, at 4:09 PM, Scott Aron Bloom wrote:
> Are you calling Q_INIT_RESOURCES ??
My resource file is named resources.qrc. I added Q_INIT_RESOURCE(resources) to a class constructor in the shared library that the client creates an instance of. The resource is used internally by the library and not accessed directly. Calling it there did not help. Is this what you meant?
Than you for your help,
-Ed
>
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Ed Sutton
> Sent: Tuesday, November 30, 2010 2:06 PM
> To: Qt-interest Interest
> Subject: [Qt-interest] Linux shared library can not load Qt resources?
> Resource initialization problem ?
>
> I added a Qt resource file to my shared library project. I added a
> "/resource" prefix then added an XSL file to the resource. I can not
> figure out how to load the resource. I found some postings about
> problems with Qt resources in libraries but did not understand or find a
> solution that worked. Has anyone seen this?
>
> QString resourcePath = ":/resource/files/eot.xsl";
> if( false == QFile::exists(resourcePath)
> {
> printf("*** Error - Resource path not found : \"%s\"\n",
> resourcePath.toLatin1().data());
> }
> else
> {
> QFile::copy(resourcePath, styleSheetPathFileName))
> }
>
>
> // File: resources.qrc
>
> <RCC>
> <qresource prefix="/resource">
> <file>files/eot.xsl</file>
> </qresource>
> </RCC>
>
> Thanks in advance,
>
> -Ed
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
-Ed
More information about the Qt-interest-old
mailing list