What I want is to completely remove a widget (purge it, delete it, etc...), but it's in a gridlayout, so even when calling removeWidget
, it still keeps a pointer, so python doesn't want to remove the object. Here is the (stripped) code:
def addRow(self, row):
self.entries.insert(row, QtGui.QLineEdit())
self.gridlayout.addWidget(self.entries[row], row, 0)
...
def remRow(self, row):
self.gridlayout.removeWidget(self.entries[row])
del(self.entries[row])
...
(in another function)
foo.addRow(0)
foo.remRow(0)
It removes the widget from the gridlayout, but it doesn't remove it completely, so it actually gets packed beneath(?) the layout, and the widget is apparently bigger than the layout (not sure though, as I cannot see the end).
So again, is there any way to completely remove a widget that was inside a QGridLayout?
Thanks in advance!