Home > Mobile >  When a layout addwidget function called after join many widgets
When a layout addwidget function called after join many widgets

Time:09-25

Addwidget function called when a layout to join many widgets, layout in the class destructor, seemingly widget was destructor,
I use it as the
Created many widgetA mainwindow, widgetB, in child form frmA addwidget widgetA and widgetB, after use, child form frmA destructor,
Then, I'll find widgetA and widgetB were destructor, feel a bit not reasonable

CodePudding user response:

In the create is not important, important is who is its parent window, because when the parent window destructor will traverse to the child window is destroyed

CodePudding user response:

After joining layout, its parent window becomes the parent window layout, so they are destructor, reasonable,

CodePudding user response:

refer to the second floor wings again hard reply:
add layout, after its parent window becomes the parent window in the layout, so they are destructor, reasonable,


Behind it is as you say, I solved the
https://blog.csdn.net/hust_bochu_xuchao/article/details/103808283
  •  Tags:  
  • Qt
  • Related