What is best way to remove items from layout in pyqt
问题 I am having some issue with layout in pyqt. After closing the items from the layout still if layout.count() returns the old item count. So I think .close() not really removing items from the layout. Here is a full working example. import sys from PyQt4 import QtGui,QtCore class LayoutTest(QtGui.QWidget): def __init__(self): super(LayoutTest, self).__init__() self.vvbox = QtGui.QVBoxLayout() self.dvbox = QtGui.QVBoxLayout() vbox = QtGui.QVBoxLayout() vbox.addLayout(self.vvbox) vbox.addLayout