title: NameError: name is not defined
body: <p>Updated Code Snippet:
  I have updated to the 'self.' convention instead of global, but still having the only value returned the empty string assigned on the class level, but if this is removed, an error is thrown.</p>
  
  <pre><code>class MainDialog(QWidget, qcDbWidget4.Ui_qcQueryWidget):
  
      dbDir = ''
      DbSelection = ''
      dbPath = ''
      TabSelection = ''
      exportDir = ''
      exportFileName = ''  
  
      def __init__(self, parent=None):
          super(MainDialog, self).__init__(parent)
          self.setupUi(self)
          self.connect(self.dbDirSelect, SIGNAL("clicked()"), self.getDirFileNames)
          self.connect(self.dbSelectButton, SIGNAL('clicked()'), self.selectDb)
          self.connect(self.tabSelectButton, SIGNAL('clicked()'), self.selectTab)
          self.connect(self.exportDirSelect, SIGNAL("clicked()"), self.getExportDir)
          self.connect(self.exportButton, SIGNAL("clicked()"), self.setExportName)
          self.connect(self.querySubmitButton, SIGNAL("clicked()"), self.setQueryParams)
          self.connect(self.querySubmitButton, SIGNAL("clicked()"), self.dbQuery)
  
      def getDirFileNames(self):
          self.dbDir = str(QFileDialog.getExistingDirectory(self))
          self.dbDirDisplay.setText(self.dbDir)
  
          dbFileList = []
          for root, dirs, files in os.walk(self.dbDir):
              for file in files:
                  if file.endswith('.db'):
                      dbFileList.append(file)
  
          self.dbSelection.addItems(dbFileList)
  </code></pre>