Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QSettings on OS X 10.9 - unable to locate/clear it

I have a Qt (4.8.5) based application running on OS X 10.9. The app uses QSettings class specifying app name and company. Plist file is created by QSetttings under:

~/Library/Preferences/com.company_name.app_name.plist

The app works pretty fine in terms of saving/restoring preferences. Then I quit the app, delete *.plist file, run the app again and voila - it restored its preferences! Based on what what file? Hot to delete it?

I was unable to find the answer in the Qt doc for QSettings class.

like image 235
Thomas Avatar asked Nov 02 '13 13:11

Thomas


People also ask

Where are QSettings stored on Mac?

The QSettings class provides persistent platform-independent application settings. Users normally expect an application to remember its settings (window sizes and positions, options, etc.) across sessions. This information is often stored in the system registry on Windows, and in XML preferences files on Mac OS X.

How does QSettings work?

QSettings stores settings. Each setting consists of a QString that specifies the setting's name (the key) and a QVariant that stores the data associated with the key. To write a setting, use setValue().


1 Answers

In 10.9 (and higher) .plist files are being cached. So once you have deleted a .plist file, the cache must be refreshed. Either log out or execute the following command in Terminal:

killall -u yourusername cfprefsd
like image 144
GeekUser Avatar answered Oct 20 '22 17:10

GeekUser