show() is totally unnecessary here, exec() calls show() internally.
exec() runs a nested event loop which processes all applications events just like the main event loop but filters out all user events targetted at the dialog's parent.
A so called modal dialog.
Caling just show() creates a non-modal dialog, which, as you correctly assumed, would need to be stored in a member variable instead of on the slot's stack.
But either way is correct, it depends on the use case of the dialog.
Not that the code you have there isn't horrible in other ways, the stray show() is the smallest problem
Cheers,
_





Reply With Quote
Bookmarks