Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to set QCoreApplication organization name and domain correctly on macOS?
If I set the domain as
com.myappand application name as
MyApp, my local settings as provided by
QStandardPaths::AppDataLocationin macOS are still located at
~\Library\Application Support\MyApp\...instead of
What is the correct way to set them up so
QStandardPaths::AppDataLocationwould point to macOS-style settings path?
There's nothing wrong with that. Take for example Spotlight, it uses com.apple.spotlight.
@SGaist Great so how can I achieve the same path for my app
mpergand last edited by
Let's clarify a few things.
For one of my apps, I define this:
app.setApplicationName(QString("BasicCalc")); app.setOrganizationName(QString("mpergand")); app.setOrganizationDomain(QString("mpergand.fr"));
After compilation I see this in the Info.plist :
Bundle name = BasicCalc Bundle Identifier = fr.mpergand.BasicCalc
Therefore, the app support path is:
The preferences file name (QSettings) is:
And it is what I expected because it's how it must work on Mac.
@mpergand Hey. Thanks for providing an example. All is good with the exception that it's not how it must work on Mac. This is how it may work. In fact apps that run in Sandbox (from AppStore) use different path. And other apps may have path
~/Library/Application Support/fr.mpergand.BasicCalc/for settings directory. The question was if it is possible to achieve this in Qt with
QStandardPathsand proper settings in
mpergand last edited by mpergand
@mpergand Hey. Thanks for providing an example. All is good with the exception that it's not how it must work on Mac. This is how it may work. In fact apps that run in Sandbox (from AppStore) use different path.
My bad, I was not aware of this (I'm not using AppleStore)
Maybe you have to add a specific entry in the info.plist for the sandbox ?
@mpergand The thing is that whether in sandbox or not, app learns about appropriate paths available for writing using system calls (like
NSLibraryDirectory). I'm only trying to learn if it's possible to achieve this with Qt.