title: QSettings - how to honour when user deletes file?
body: <p>I am trying to figure out the simplest use of <a href="https://doc-snapshots.qt.io/qtforpython/PySide2/QtCore/QSettings.html#PySide2.QtCore.PySide2.QtCore.QSettings.setValue" rel="nofollow noreferrer">QSettings</a> with this snippet:</p>
  
  <pre><code>from PySide2 import QtCore
  settings = QtCore.QSettings("TestCompany", "TestApp")
  settings.setValue('testValue', 100)
  </code></pre>
  
  <p>On OSX this eventually writes a plist to:</p>
  
  <pre><code>/Users/frank/Library/Preferences/com.testcompany.TestApp.plist
  </code></pre>
  
  <p>As per the <a href="https://doc-snapshots.qt.io/qtforpython/PySide2/QtCore/QSettings.html#PySide2.QtCore.PySide2.QtCore.QSettings.setValue" rel="nofollow noreferrer">docs</a> the changes may not be written immediately for efficiency reasons.</p>
  
  <p>Once I see the plist file though, I assumed I could delete it, so that next time I launch my application an attempt to return a value from a new settings instance would return None.</p>
  
  <p>However, even when I delete the plist file and close my python interpreter, then re-open it and construct a new <a href="https://doc-snapshots.qt.io/qtforpython/PySide2/QtCore/QSettings.html#PySide2.QtCore.PySide2.QtCore.QSettings.setValue" rel="nofollow noreferrer">QSettings</a> instance, it still somehow manages to retrieve the previously set value for "testValue".</p>
  
  <p>How can I manage this so that when a user deletes the settings file and restarts the QT application, they get a clean slate rather than old values?</p>
  
  <p>Do I have to manually check for the existence of the plist file and use <a href="https://doc-snapshots.qt.io/qtforpython/PySide2/QtCore/QSettings.html#PySide2.QtCore.PySide2.QtCore.QSettings.clear" rel="nofollow noreferrer">clear()</a> to flush out any existing values in memory or is there a better way to guarantee a clean slate when the file is deleted and the app restarted?</p>