JasonGenX
JasonGenX

Reputation: 5434

Cross platform QRC file, possible?

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.

Upvotes: 5

Views: 1775

Answers (1)

dabhaid
dabhaid

Reputation: 3879

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.

Upvotes: 11

Related Questions