Home > other >  QTabWidget tabs to delete
QTabWidget tabs to delete

Time:05-09

Has built a QTabWidget object, then calls the addTab adds several tabs, each time adding a TAB, memory usage will be increased, but after I close the TAB, memory usage does not reduce because of this, I don't know why, ask tall person to give directions, how can the response is closed, completely closed tabs of the form, the SIGNAL correlation for: connect (this, SIGNAL (tabCloseRequested (int)), this, SLOT (closeTab (int))); Response to a closed slot is: void TabWidget: : closeTab (int index) {QWidget * currenttabwidget=widget (index); Currenttabwidget - & gt; close();//is set currenttabwidget properties for setAttribute (Qt: : WA_DeleteOnClose, true); RemoveTab (index); }

CodePudding user response:

The delete?

CodePudding user response:

I also encountered this problem, the building Lord solved? Now I can only add a close button widget inside to free memory, through the above TabClose set properties can release the memory
  • Related