title: How to access dynamically created tablewidget?
body: <p>in my project I create three items : QCombobox,QLabel,QCheckbox from a database for every productname (which give name of itself to QLabel as text). After that I list those items in a QTableWidget. The thing I want to do is reaching selected QCheckbox's row's QLabel's text and current index of same row's QCombobox.</p>
  <p>I can reach the selected QCheckboxs of QTableWidget but for further I don't know how to reach other items of QCheckbox's row.</p>
  <p><strong>The function is current_index which should return QLabel's text and QCheckbox's text.</strong></p>
  <pre><code>import sys
  from PyQt5 import QtWidgets,QtGui,QtCore
  from PyQt5.QtWidgets import QLabel,QMainWindow,QApplication,QHeaderView,QTableWidgetItem,QMessageBox,QWidget
  from uretim_sayfasi import Ui_MainWindow
  import mysql.connector
  global curs
  global conn
  
  conn=mysql.connector.connect(
      host=&quot;*****&quot;,
      user=&quot;****&quot;,
      password=&quot;*****&quot;,
      database=&quot;****&quot;
      )
  curs=conn.cursor()
  
  class my_app(QMainWindow):
      def __init__(self):
          super(my_app, self).__init__()
          self.ui=Ui_MainWindow()
          self.ui.setupUi(self)
          self.list_products()
          self.ui.pushButton.clicked.connect(self.current_index)
  
      def list_products(self):
          curs.execute(&quot;SELECT productName,productId FROM products_list&quot;)
          products=curs.fetchall()
          curs.execute(&quot;SELECT shipmentTime FROM shipmentTime ORDER BY id&quot;)
          shipmentTime=curs.fetchall()
          c=0
          for i in products:
              self.ui.productlist.setRowCount(int(c + 1))
              self.ui.productlist.setColumnCount(3)
              e=QtWidgets.QLabel()
              e.setText(i[0])
              self.combo=QtWidgets.QComboBox()
              self.combo.addItems(j[0] for j in shipmentTime)
              self.checkbox=QtWidgets.QCheckBox(i[1])
              self.checkbox.setObjectName(i[1])
              self.ui.productlist.setCellWidget(c,2,self.combo)
              self.ui.productlist.setCellWidget(c,0,self.checkbox)
              self.ui.productlist.setCellWidget(c,1,e)
  
              c+=1
  
  
      def current_index(self):
          items=self.ui.productlist.findChildren(QtWidgets.QCheckBox)
          for i in items:
              if i.isChecked():
                  n=i.objectName()
                  print(n)
  
  def app():
      app=QApplication(sys.argv)
      win=my_app()
      win.show()
      sys.exit(app.exec_())
  
  app()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/J8Nro.png" rel="nofollow noreferrer">the result table</a>
  In my senario, when pushbutton clicked, it should return selected QCheckbox's (ARG.YI.2002 and ARG.YI.2021) QLabel's text **(&quot;KREMA&quot; for ARG.YI.2002 and &quot;CEVİZİÇİ EXTRA&quot; for ARG.YI.2021) ** and QCombobox's currenttext  <strong>(&quot;5 GÜN&quot; for ARG.YI.2002 and &quot;1 GÜN&quot; for ARG.YI.2021)</strong>.</p>