Since the dialog is allocated on the heap, you may also use attributes to make the dialog automatically deleted once it's closed:
Qt Code:
  1. dlg->setAttribute(Qt::WA_DeleteOnClose);
To copy to clipboard, switch view to plain text mode