Details
Description
When generating the python code of a Widget with multiple *QTableWidget*s, the index that is assigned to the *horizontalHeaderItem*s keeps incrementing. See code snippet.
self.tableWidget.setColumnCount(3) self.tableWidget_2.setColumnCount(3) ... self.tableWidget.horizontalHeaderItem(0).setText(QtWidgets.QApplication.translate("MyForm", "New Column", None, -1)) self.tableWidget.horizontalHeaderItem(1).setText(QtWidgets.QApplication.translate("MyForm", "New Column", None, -1)) self.tableWidget.horizontalHeaderItem(2).setText(QtWidgets.QApplication.translate("MyForm", "New Column", None, -1)) self.tableWidget_2.horizontalHeaderItem(3).setText(QtWidgets.QApplication.translate("MyForm", "New Column", None, -1)) self.tableWidget_2.horizontalHeaderItem(4).setText(QtWidgets.QApplication.translate("MyForm", "New Column", None, -1)) self.tableWidget_2.horizontalHeaderItem(5).setText(QtWidgets.QApplication.translate("MyForm", "New Column", None, -1))
As a result, the code crashes as it tries to set the text in an Item that doesnt exist for the tableWidget_2