我无法弄清楚如何初始化Red Hat Enterprise Linux 5.2下共享库中声明和使用的Qt资源.
我在我的共享库中添加了一个Qt资源文件,添加了一个名为"resource"的前缀,并添加了一个文件"files/styleSheet.xsl".资源文件名为"resources.qrc".QFile :: exists返回false?
MySharedLib::MySharedLib()
{
// I think Q_INIT_RESOURCE basically expands to this:
// The resource file is named "resources.qrc"
extern int qInitResources_resources();
qInitResources_resources();
QString resourcePath = ":/resource/files/styleSheet.xsl";
if( false == QFile::exists(resourcePath))
{
printf("*** Error - Resource path not found : \"%s\"\n", resourcePath.toLatin1().data());
}
}
Run Code Online (Sandbox Code Playgroud)
提前感谢任何提示或建议,