either just do not delete it but just let it become hidden (no problem at all; it will just use a bit of memory...)
or
store the pointer to the dialog in a QPointer (always a good idea!) so you get "notified" (well, not you, but the QPointer) about the demise of the dialog and you do not end up with an invalid dangling pointer.
HTH
Bookmarks