PDA

View Full Version : QTableWidget Deleting c/c++ Object on custom Widget addition.



PatchPaper
19th October 2010, 19:45
I'm working with PyQt4 4.7.7 and python 2.7
I am populating a table with custom widgets using the setCellWidget command. This works for the inital table population. Later when I want to display only specific widgets, I use clearContents and set the rowcount to zero. Then I add back in the widgets I want onto the table.

This results in a c/c++ object deleted error. The first re population will give me back empty rows, and the second after that, will result in the error.

When I switch out the custom widget for just plain text, using the exact same commands (except for setCellWidget for setItem ) this works perfectly fine.

Since this is happening on the second and third times I populate the table, and not the first, I'm rather confused as to what is happening.

I've provided a working example of what is happening:
http://dl.dropbox.com/u/11715751/trackSetLoader.rar

Thanks for any insight.