title: How do I prevent the enter key from closing my QDialog (Qt 4.8.1)
body: <p>I have a <code>QDialog</code> with a <code>QDialogButtonBox</code>. The <strong>OK</strong> and <strong>Cancel</strong> buttons are active. Occasionally I disable or hide the OK button based on the state of my dialog. It seems, no matter what I do, the Enter key always activates the OK button. I really DON'T want this to happen. I have tried:</p>
  
  <ul>
  <li>Setting default and autoDefault properties to false every time I show/hide/enable/disable/whatever the button</li>
  <li>installing an event filter on the OK button to intercept key events (pressed and released) for return, enter and space</li>
  <li>Setting the focus policy on the button to <strong>NoFocus</strong></li>
  </ul>
  
  <p>And with all combinations of those things above, the Enter key still accepts the dialog. Does anyone have any clue how to block this? It seems like I should be able to block something as simple as this?</p>