开发者

Qt resource files in OS X application bundle

开发者 https://www.devze.com 2023-03-05 15:03 出处:网络
I\'m trying to build a Qt project which runs fine on windows on OS X 10.6. However, my application cannot access the resources in my qrc file anymore. Are all files in the qrc packed in that applicati

I'm trying to build a Qt project which runs fine on windows on OS X 10.6. However, my application cannot access the resources in my qrc file anymore. Are all files in the qrc packed in that application bundle (xyz.app) by default? When I open the generated bundle, there's nothing in the Resources folder except the desktop.rc file. Am I missing somethi开发者_运维百科ng?


Qt translates/converts qrc files into cpp files then compiles and links them into the application binaries. There's no resource file in OS X sense.

The only separate resource file Qt can handle is the application icon. Add this line to pro file:

ICON = MyAppIcon.icns

And it will be copied to the Resources folder and info.plst will be updated to use it.


File names in Windows are not case sensitive, but in OS X they are. Could it be that the file names (or directory names) in your code differ in case from the file names in the resources? If they are, they would still work in Windows but not in OS X.


Well, actually we I switched from a german windows to a us version of osx. All our resources had "de" in their language field, so my us osx couldn't find any resource at all.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号