title: QDialog.exec() vs open()
body: <p>The docs for QDialog suggest avoiding <code>exec()</code> in favor of <code>open()</code> because of possible bugs that can be introduced when exec() is used. <code>open()</code> doesn't block, so you need to catch a signal like <code>finished()</code> to detect that the dialog has been closed. If the dialog is capturing values (eg, text edit or combo box), you must have access to the QDialog object in order to fetch the values. Since you can't pass this to the function connected to the <code>finished()</code> signal, the variable must have scope that includes this function. Not the end of the world, but the <code>exec()</code> approach doesn't require catching the <code>finished()</code> signal and defining another function - you're still in the scope of the QDialog object that was <code>exec()</code>ed, so you can immediately access the desired values.</p>
  <p>All of this leads to the question, how bad is it to use <code>exec()</code> instead of <code>open()</code>? I looked at the code for QGetOpenFileName to see how it was able to display a dialog and return a value, and it uses <code>exec()</code>, so clearly it's not the end of the world. Are there precautions one can take to avoid the downsides of this choice?</p>