开发者

Cross platform QRC file, possible?

Is it possible to have platform sections within a QRC file as we can do with 开发者_Python百科a QT .Pro file? (e.g. macx, win32, etc.)

I was wondering if I could split the mac, windows, linux specific resources into sections in the QRC file itself, or have three QRC files for each platform and doing the platform conditional sections from the .pro file referencing them.


The resource system is just for packaging up binary files with the executable, you can't have it discriminate at make which resources are packaged, but yes, you can make multiple .qrc packages and add them by platform to your .pro

RESOURCES += common.qrc
win32:RESOURCES += windows.qrc
linux:RESOURCES += linux.qrc
mac:RESOURCE += mac.qrc

Alternatively you could have platform prefixes in your .qrc and refer to the resources like :/(set platform string)/resource/file.end. The first way is neater, as only the resources in the .qrc files you add to the build will be added to the application executable.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜