Qt Target with special characters

2019-06-08 16:21发布

问题:

I have a QT application and right know I need to change the app name to something like "A&B".

I have tried to change the TARGET in my .pro file, but I am having problems with the "&" character in macOS.

I have also tried to use qmake functions like val_escape, system_quote, shell_quote but nothing worked for me.

As a last resource, I have tried to change the CFBundleName in my .plist file, which worked for app menus and etc, but not for the app name (still having problems with &, as make is considering the app to be called B.app instead of A&B.app

Do you know any other way to get this problem fixed? Is there even a way to have a macOS application with a name like A&B.app?

Thanks in advance

回答1:

I dont think you are following the right approach. What the client want is perhaps change the "user visible" strings for the application name to "A&B" - for that you need to check out the following functions in QCoreApplication:

applicationName : QString
applicationVersion : QString
organizationDomain : QString


回答2:

I fixed this by adding a DisplayName to my configuration and changing the applicationDisplayName in the Info.plist. Thanks anyway.