在QMdiArea里添加了widgets, 然后再remove掉,内存一直涨没有降下去。有大佬知道是什么情况吗?
下面的是简单的code:
def addSub(self):
label = QLabel("xxxx...")
label.setAttribute(Qt.WA_DeleteOnClose)
self.MyMdi.addSubWindow(label, Qt.WindowFlags(0))
label.show()
def closeAllSubs(self):
sublist = self.MyMdi.subWindowList()
for sub in sublist:
sub.removeSubWindow(sub)
也试过用sip.delete, 和deleteLater 大概如下面这样, 都不 管用
widget = sub.widget()
sip.delete(widget)
sub.removeSubWindow(sub)
sip.delete(sub)