Hello!

I'm currently working on a programm which adds a QTableWidget to an existing 
QGridLayout using QGridLayout.addWidget(). When the user pushes button btn1, 
this QTableWidget should disappear and the layout should free the space.

In order to achieve this aim I tried the following:

[...]
self.ui.gridlayout.removeWidget(self.legend)
del self.legend
[...]

=> The QTableWidget is indeed removed from the layout, but still exists in the 
   GUI.

[...]
self.ui.gridlayout.removeWidget(self.legend)
import sip
sip.delete(self.legend)
[...]

=> works as expected

Is this really the right way to do it? Why doesn't the del-approach work? 
Actually no other PyQT objects should hold any other references to 
self.legend.

Thanks,
Fabian
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to