python - Is there any way to remove a QWidget in a QGridLayout? -
What do I need to remove a widget completely (purge it, delete it, etc ...), but It's a gridlate, so even when calling Then, is there any way to completely remove any program from within a QGridLayout? Thank you in advance! Contains the widgets for containers again even if you remove it from the layout, the container widget Still have parents, so that the widget can not be removed. You should call removeWidget , it still keeps an indicator, so the dragon does not want to remove the object. Here is the (hidden) code:
def addRow (auto, line): self.entries.insert (line, QtGui.QLineEdit ()) self.gridlayout.addWidget (self.entries [ Line], line, 0) ... def remRow (self, line): self.gridlayout.removeWidget (self.entries [row]) del (self.entries [row]) ... (in other functions) foo Deletes the widget from the gridlate, but it does not completely delete it, so it actually gets packaged under the (?) Layout, and the widget is apparently larger than the layout (not sure though , As i Can not see the end.) .deleteLater () to get rid of that widget (effectively removing all the references for the widget so that Python can clean it):
def Remaro (self, line): self Grad Outout Revuejet (self inputs [row]) self Inputs [row] .deleteLater () Dell himself Entries [row]
Comments
Post a Comment