[PyQt] QTableWidget warning message

Phil phil_lor at bigpond.com
Sat Apr 6 08:35:31 BST 2013

Thank you for reading this.

I'm writing repeatedly to a single row table like this;

self.tableWidget.setitem(0, column, item)

The first write is OK but subsequent writes cause the following message 
to be displayed;

"QTableWidget: cannot insert an item that is already owned by another 

I have tried clear() and clearContents() before the write but then this 
error message id displayed;

"wrapped C/C++ object of %S has been deleted"

My code works correctly except the printing of the error message slows 
it's operation. How can I suppress or prevent this message?

This problem is caused by some set up code that revolves around 
QTableWidgetItem that I once only to align the data centrally within the 
table cells. Without that there are no error messages. So I can see the 
source of the problem but I don't know how to cure it.


More information about the PyQt mailing list