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::
Richardwb's answer is a good one - but the other approach is to use the deleteLater slot, like so:
Des *test = new Des; test->show(); connect(test, SIGNAL(closed()), test, SLOT(deleteLater()));
Obviously the closed() signal can be replaced with whatever signal you want.