So, the exec( ) should be abandoned ?
-
I thind most of Qter know these three articles:
• Unpredictable exec()
• QtQuarterly30 : New Ways of Using Dialogs
• How to crash (almost) every Qt/KDE Application and how to fix itIt is seems that the exec() to be a little evil . So , If we overloading of QDialog, we should avoiding using the exec() ?
-
Please post links to these articles, I do not know them.
Without reading them, I'd say
exec()
is OK, especially for small and simple things (like getting a save file name, displaying a popup message etc.), as long as you remember that main event loop will be spinning in the background. -
@cyberpunker
I have read various articles on this. Meanwhile I have usedexec()
just as you would expect happily for years, and found no ill effects. So up to you, but especially as I think you are learning I would useQDialog::exec()
where appropriate and not worry about it :)[Moved in from a duplicate topic ~kshegunov]
-
Hi
if exec( ) should be abandoned i will surely burn in hell as my main Qt project is
mainly QDialogs using exec(). :) -
If you are heavily processing custom events or using threading, you may have unexpected behavior because it's not the same event loop that will be processing these events while exec is running hence the recommendation of using open and a slot for the result handling.