destructors in Qt4

后端 未结 5 1085
小鲜肉
小鲜肉 2020-12-31 11:17

I\'m very confused about using destructors in Qt4 and hope, you guys can help me.
When I have a method like this (with \"Des\" is a class):

void Widget::         


        
5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-31 12:13

    This tutorial suggests you don't need to explicitly delete widgets that have been added to parent widgets. It also says it doesn't hurt to do delete them either.

    (I've not tested this, but I guess as long as you explicitly delete them before the parent widget is deleted, this should be OK.)

提交回复
热议问题