Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross platform QRC file, possible?

Tags:

macos

qt

Is it possible to have platform sections within a QRC file as we can do with 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.

like image 694
JasonGenX Avatar asked Jan 19 '11 21:01

JasonGenX


1 Answers

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.

like image 183
dabhaid Avatar answered Sep 28 '22 16:09

dabhaid