title: PyQt4 AttributeError: 'function' object has no attribute 'self'
body: <p>I can't change the values in the GUI table from the main program. I get an error </p>
  
  <blockquote>
    <p>AttributeError: 'function' object has no attribute 'commandTable'</p>
  </blockquote>
  
  <p>I have read and tried the solution shown in this question and it did not work.</p>
  
  <p><a href="https://stackoverflow.com/questions/35182936/attributeerror-function-object-has-no-attribute-self">AttributeError: &#39;function&#39; object has no attribute &#39;self&#39;</a></p>
  
  <p>What should I change in my code to get the code to work?</p>
  
  <p>Main code:</p>
  
  <pre><code>import sys
  from PyQt4 import QtCore, QtGui
  
  from GUI_Window import *
  
  
  class MyForm(QtGui.QMainWindow):
      def __init__(self, parent=None):
         QtGui.QWidget.__init__(self, parent)
         self.ui = Ui_MainWindow()
         self.ui.setupUi(self)
         self.ui.setupUi.commandTable.setItem(0,0, QtGui.QTableWidgetItem('1'))
  
  if __name__ == "__main__":
     app = QtGui.QApplication(sys.argv)
     myapp = MyForm()
     myapp.show()
     sys.exit(app.exec_())
  </code></pre>
  
  <p>gui code</p>
  
  <pre><code>from PyQt4 import QtCore, QtGui
  import sys
  
  try:
     _fromUtf8 = QtCore.QString.fromUtf8
  except AttributeError:
     def _fromUtf8(s):
        return s
  
  try:
     _encoding = QtGui.QApplication.UnicodeUTF8
     def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig, _encoding)
  except AttributeError:
      def _translate(context, text, disambig):
      return QtGui.QApplication.translate(context, text, disambig)
  
  class Ui_MainWindow(object):
   def setupUi(self, MainWindow):
      MainWindow.setObjectName(_fromUtf8("MainWindow"))
      MainWindow.resize(821, 544)
      self.centralwidget = QtGui.QWidget(MainWindow)
      self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
      self.gridLayout = QtGui.QGridLayout(self.centralwidget)
      self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
      self.table = QtGui.QTableWidget(self.centralwidget)
      self.table.setRowCount(0)
      self.table.setObjectName(_fromUtf8("table"))
      self.table.setColumnCount(0)
      self.gridLayout.addWidget(self.table, 0, 0, 1, 1)
      self.label = QtGui.QLabel(self.centralwidget)
      self.label.setObjectName(_fromUtf8("label"))
      self.gridLayout.addWidget(self.label, 2, 0, 1, 1)
      self.progressBar = QtGui.QProgressBar(self.centralwidget)
      self.progressBar.setProperty("value", 24)
      self.progressBar.setObjectName(_fromUtf8("progressBar"))
      self.gridLayout.addWidget(self.progressBar, 2, 1, 1, 1)
      self.commandTable = QtGui.QTableWidget(self.centralwidget)
      self.commandTable.setEnabled(True)
      self.commandTable.setAlternatingRowColors(False)
      self.commandTable.setRowCount(2)
      self.commandTable.setColumnCount(10)
      self.commandTable.setObjectName(_fromUtf8("commandTable"))
      self.commandTable.setItem(0,0, QtGui.QTableWidgetItem('hi'))
      self.commandTable.horizontalHeader().setCascadingSectionResizes(False)
      self.commandTable.horizontalHeader().setSortIndicatorShown(False)
      self.commandTable.horizontalHeader().setStretchLastSection(False)
      self.commandTable.verticalHeader().setCascadingSectionResizes(False)
      self.gridLayout.addWidget(self.commandTable, 1, 0, 1, 2)
      MainWindow.setCentralWidget(self.centralwidget)
      self.menubar = QtGui.QMenuBar(MainWindow)
      self.menubar.setGeometry(QtCore.QRect(0, 0, 821, 18))
      self.menubar.setObjectName(_fromUtf8("menubar"))
      MainWindow.setMenuBar(self.menubar)
      self.statusbar = QtGui.QStatusBar(MainWindow)
      self.statusbar.setObjectName(_fromUtf8("statusbar"))
      MainWindow.setStatusBar(self.statusbar)
      self.retranslateUi(MainWindow)
      QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
  def retranslateUi(self, MainWindow):
      MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))
      self.label.setText(_translate("MainWindow", "TextLabel", None))
  </code></pre>
  
  <p>Sorry that the last part isnt well formatted</p>