Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Modal QDialog without exec()?
Joachim W last edited by
QDialog::exec()doc says: "Avoid using this function; instead, use
Does this mean: avoid modal dialogs for good, always use modeless dialogs?
Or is there recommended way to run a modal dialog starting with
JonB last edited by JonB
You can make the dialog be modal with this when it
exec()does that automatically (regardless of
setModal()), but also sits there waiting, whereas
open()with modal does the modality but does not spin the wait loop (but you can act on signal https://doc.qt.io/qt-5/qdialog.html#finished).
So long as you don't do anything "naughty", I like a lot of people find it fine to use
exec()for the default, normal cases. Purists may advise
exec()works fine for me.