Home > Mobile >  Qt jump button is used to implement the interface between the occasional flash back
Qt jump button is used to implement the interface between the occasional flash back

Time:01-14

 
Void todoPage: : on_dustbin_button_clicked ()
{
DustbinPage * w=new dustbinPage;
W - & gt; Show ();
This - & gt; close();
Delete this.
}

Jump between multiple interface is quit, all buttons are written in this way, at present only is already delete, to locate the current interface were destructor after flash back,
And not every time to run the program will quit, could you tell me how to troubleshoot problems, should be

CodePudding user response:

Widgets don't invoke delete directly because it may have events to process, you can call widgets - & gt; DeleteLater (), or the widget property is set to this - & gt; The setAttribute (Qt: : WA_DeleteOnClose);
After calling the close widget will automatically destructor, don't have to call the delete,
  •  Tags:  
  • Qt
  • Related