title: C++ Qt Inherit QMessageBox to delay user input in order to prevent unintended action
body: <p><strong>Problem</strong></p>
  
  <p>Windows has a system setting that will cause the mouse pointer to jump (move) to a new focus element automatically, e.g. the default button of a dialog that pops up. While the advantage is an increase in speed and a reduction of mouse movements, it has a disadvantage:</p>
  
  <p>If this happens just when before the user clicks on another element, the user is unable to abort his/her action in time and will immediately accept the dialogs default button because the focus is moved by the system. Usually this may entail cumbersome work to retrace the steps up to this point (think a file chooser dialog that forgot the very long path you input previously) but it could also mean triggering an irreversible process (e.g. file deletion).</p>
  
  <p><strong>Aim</strong></p>
  
  <p>Essentially I would like to disable the dialog's inputs for a small amount of time, just enough to prevent an inadvertant mouse click or keyboard button press.</p>
  
  <p><strong>Question</strong></p>
  
  <p>It comes down to a C++ question, namely how to access the base classes' objects (GUI widgets) from the inheriting class, i.e. </p>
  
  <ol>
  <li>disable the button widgets of a QMessageBox</li>
  <li>start a single shot QTimer and connect it to a slot that</li>
  <li>enables the previously disabled widgets</li>
  </ol>
  
  <p>(As alternative, I probably could reimplement input event handlers that suppress all input for a specific amount of time, but although I intend to keep that time very short (e.g. 100 ms), the user is not informed of the disabled input using that method.)</p>
  
  <p>A simple class derived from QDialogBox can be found at <a href="http://www.qtforum.org/article/24342/messagebox-auto-close-mouse-event-close.html" rel="nofollow">http://www.qtforum.org/article/24342/messagebox-auto-close-mouse-event-close.html</a>.</p>