title: Setting multiple initial values in PyQt form
body: <p>I have been trying to create a settings window for an application I'm developing and I want to populate the settings window with either a config file (which I will later write the answers to) or the system defaults if the config file is absent or cannot be opened. </p>
  
  <p>I have seen examples where a few values are populated after the <code>setupUi(self)</code> is executed, however I have around 15-20 values and so having 2 huge if statements seems messy. Here is my current state of affairs and I can't figure out how to make it call the function I have created <code>getConfig</code></p>
  
  <p>Is this the best way to populate values? Or is there something else I should try?</p>
  
  <pre><code>class SettingsWindow(QtGui.QMainWindow):
      def __init__(self, parent=None):
          QtGui.QMainWindow.__init__(self, parent)
          self.ui = Ui_SettingsWindow()
          self.ui.setupUi(self)
          self.ui.getConfig(self) #my problem is here
          ... #all the action bindings
  
      def getConfig(self):
          if not os.path.exists('app.config'):
              self.ui.setDefaults(self) #fallback to defaults if no config file
          with open('app.config') as f:
              self.config = json.load(f)
              ... #bind all the default values
  </code></pre>