新建了一个QTabWidget对象,然后调用了addTab添加了几个标签页,每次添加一个标签页,内存使用就会有所增长,但是我关闭标签页后,内存使用并不会因此而减少,不知道为什么,求高人指点,怎样才能在响应关闭时,彻底关闭标签页所对应的窗体。
信号关联为:
connect(this,SIGNAL(tabCloseRequested(int)),this,SLOT(closeTab(int)));
响应关闭的槽为:void TabWidget::closeTab(int index)
{
QWidget * currenttabwidget = widget(index);
currenttabwidget->close();//已经设置了currenttabwidget属性为setAttribute(Qt::WA_DeleteOnClose,true);
removeTab(index);
}