title: How to add item to dynamically created QComboboxes in Pyqt
body: <p>I'm trying to add items to the dynamically created comboboxes.
  I know my variables override themselves and i can't get the desired result. Combobox actions add the items to the last one which i don't want. It needs to add items to the right next one.</p>
  
  <pre><code>from PyQt4 import QtCore, QtGui
  
  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)
  i = 1
  
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName(_fromUtf8("MainWindow"))
          MainWindow.resize(620, 500)
  
          #LAYOUT SETTINGS
          self.centralwidget = QtGui.QWidget(MainWindow)
          self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
          self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
          self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
          self.gridLayout = QtGui.QGridLayout()
          self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
  
          self.pushButton = QtGui.QPushButton(self.centralwidget)
          self.pushButton.setMinimumSize(QtCore.QSize(30, 30))
          self.pushButton.setMaximumSize(QtCore.QSize(30, 30))
          self.pushButton.setObjectName(_fromUtf8("pushButton"))
          self.gridLayout.addWidget(self.pushButton, 0, 0, 1, 1)
  
          self.pushButton.clicked.connect(self.addNewCombobox)
          self.pushButton.clicked.connect(self.addNewSCombobox)
          self.pushButton.clicked.connect(self.addNewButton)
  
          self.comboBox = QtGui.QComboBox(self.centralwidget)
          self.comboBox.setMinimumSize(QtCore.QSize(0, 30))
          self.comboBox.setMaximumSize(QtCore.QSize(16777215, 30))
          self.comboBox.setObjectName(_fromUtf8("comboBox"))
          self.comboBox.addItem(_fromUtf8(""))
          self.gridLayout.addWidget(self.comboBox, 0, 1, 1, 1)
  
          self.scomboBox = QtGui.QComboBox(self.centralwidget)
          self.scomboBox.setMinimumSize(QtCore.QSize(0, 30))
          self.scomboBox.setMaximumSize(QtCore.QSize(16777215, 30))
          self.scomboBox.setObjectName(_fromUtf8("ScomboBox"))
          self.gridLayout.addWidget(self.scomboBox, 0, 2, 1, 1)
  
          spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
          self.gridLayout.addItem(spacerItem, 9999, 0, 1, 1)
          self.verticalLayout.addLayout(self.gridLayout)
          MainWindow.setCentralWidget(self.centralwidget)
  
          self.retranslateUi(MainWindow)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
      def addNewButton(self):
          print "Added"
          global i
          self.pushButton = QtGui.QPushButton(self.centralwidget)
          self.pushButton.setMinimumSize(QtCore.QSize(30, 30))
          self.pushButton.setMaximumSize(QtCore.QSize(30, 30))
          self.pushButton.setObjectName(_fromUtf8("pushButton"))
          self.pushButton.setText("-")
          self.gridLayout.addWidget(self.pushButton, i, 0, 1, 1)
          self.pushButton.clicked.connect(self.comboBox.deleteLater)
          self.pushButton.clicked.connect(self.scomboBox.deleteLater)
          self.pushButton.clicked.connect(self.pushButton.deleteLater)
          i += 1
  
      def addNewCombobox(self):
          self.comboBox = QtGui.QComboBox(self.centralwidget)
          self.comboBox.setMinimumSize(QtCore.QSize(0, 30))
          self.comboBox.setMaximumSize(QtCore.QSize(16777215, 30))
          self.comboBox.addItem("foo")
          self.comboBox.addItem("bar")
          self.comboBox.setObjectName(_fromUtf8("comboBox_" + str(i)))
          self.gridLayout.addWidget(self.comboBox, i, 1, 1, 1)
          self.comboBox.activated[str].connect(self.addItem)
  
      def addNewSCombobox(self):
          self.scomboBox = QtGui.QComboBox(self.centralwidget)
          self.scomboBox.setMinimumSize(QtCore.QSize(0, 30))
          self.scomboBox.setMaximumSize(QtCore.QSize(16777215, 30))
          self.scomboBox.setObjectName(_fromUtf8("ScomboBox_" + str(i)))
          self.gridLayout.addWidget(self.scomboBox, i, 2, 1, 1)
  
      def addItem(self, activetext):
          # sendin = self.centralwidget.sender()
          self.scomboBox.addItem(activetext)
  
  
      def retranslateUi(self, MainWindow):
          MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))
          self.comboBox.setItemText(0, _translate("MainWindow", "New Item", None))
          self.pushButton.setText(_translate("MainWindow", "+", None))
  
  
  if __name__ == "__main__":
      import sys
      app = QtGui.QApplication(sys.argv)
      MainWindow = QtGui.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>I think i need some changes right here. I tried setting objectnames and somehow connect comboboxes but i didn't.</p>
  
  <pre><code>    def addItem(self, activetext):
      # sendin = self.centralwidget.sender()
      self.scomboBox.addItem(activetext)
  </code></pre>