在Mac OSX 10 Qt / C ++存储系统范围QSettings在哪里? [英] Where does Qt/C++ Store System Scope QSettings on Mac OSX 10?

查看:242
本文介绍了在Mac OSX 10 Qt / C ++存储系统范围QSettings在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据Qt的最新Qt版本的文档,查看 QSettings ,他们说,Mac上的系统设置范围存储在/ etc / xdg目录中。不幸的是,我不是在Mac OSX 10.10 Yosemite的情况。他们在哪里存储这些设置?我的意思是,我已经让QSettings在此示例中工作,但没有找到/ etc / xdg文件夹当我做 sudo su 并假设在我的Mac上的根以访问该文件夹。

According to Qt's docs for the latest Qt version, looking at QSettings, they say that system scope of settings on a Mac are stored in a directory /etc/xdg. Unfortunately, I'm not finding this to be the case on Mac OSX 10.10 Yosemite. Where do they store these settings? I mean, I've gotten QSettings to work in this example, but no /etc/xdg folder is to be found even when I do sudo su and assume root on my Mac in order to access that folder.

推荐答案

在MacOS上, $ HOME / Library / Preferences / 应该是用户设置的位置, / Library /

On a MacOS, $HOME/Library/Preferences/ should be the location for user settings, while /Library/Preferences/ is the path for default settings (and a user can't write on it).

如果在较新版本的MacOS上,Qt使用Unix '路径,那么你应该看看 / etc / xdg / $ HOME / .config /

If on newer version of MacOS Qt uses the Unix' paths, then you should look at /etc/xdg/ or $HOME/.config/

在所有四种情况下,这些目录包含单个 .rc 文件和(可选)所有其他配置文件。

In all the four cases, those directory contains a single .rc file and (optionally) a subir named as the software which contains all other config files.

这篇关于在Mac OSX 10 Qt / C ++存储系统范围QSettings在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆