[Qt-interest] Linux shared library can not load Qt resources?Resource initialization problem ?
Scott Aron Bloom
Scott.Bloom at onshorecs.com
Tue Nov 30 23:19:10 CET 2010
Please don't respond to my email.. Reply to the list...
Yes, however, I usually call it for all my DLLs that contain resources
from the main.cpp or after they are loaded via a QLibrary::load
Scott
-----Original Message-----
From: Ed Sutton [mailto:ESutton at fescorp.com]
Sent: Tuesday, November 30, 2010 2:17 PM
To: Scott Aron Bloom
Subject: Re: [Qt-interest] Linux shared library can not load Qt
resources?Resource initialization problem ?
>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
>
> Scott
>
> -----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