wrapped C/C++ object of type QPushButton has been deleted
код
import sys from PyQt4 import QtGui from PyQt4 import QtCore class Main(QtGui.QTableWidget): def __init__(self): QtGui.QTableWidget.__init__(self) self.setColumnCount(2) self.setRowCount(5) self.resize(500,300) self.button=QtGui.QPushButton('...', self) self.button.hide() self.connect(self, QtCore.SIGNAL('cellClicked(int, int)'), self.addButton) def addButton(self): modelIndex=self.currentIndex() col=modelIndex.column() row=modelIndex.row() self.setCellWidget(row,col+1, self.button) app=QtGui.QApplication(sys.argv) main=Main() main.show() sys.exit(app.exec_())