[Qt-interest] Linux shared library can not load Qt resources? Resource initialization problem ?
Ed Sutton
ESutton at fescorp.com
Tue Nov 30 23:06:04 CET 2010
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
More information about the Qt-interest-old
mailing list