Add QPushButton into exist QTableWidget - Python

Viewed 34

enter image description here

Hi, I have the following QTableWidget which already is updated with data from dataframe. I am using 2 "for" loops to fill it up, one for row and one for cols. Trying to add to each row in the 1st (before col "X") QPushButton that will pop a new window for future propose.

for j in range(self.tablewidget.columnCount()):
for i in range(self.tablewidget.rowCount()):
    self.push_btn = QPushButton()
    self.tablewidget.cellWidget(i,j)
    self.tablewidget.setCellWidget(i, 0, self.push_btn )

With this, the app gets stuck until crashes without any info.

Thanks alot!

1 Answers

Managed to fix it, the issue was with Qrunnable threads, my method for inserting setCellWidget didn't wait until the finished signal.

Thanks!

Related