Closing the dialog from within showEvent might not be... safe. It's like you'd try to delete "this" from the constructor... Showing the messagebox there might also be causing problems. You might look into Qt's sources to see how ShowEvent is handled.