title: How do you get a widget's children in Qt?
body: <p>I'm simulating keyPresses to an application through Qt's KeyPress function. All the KeyPresses work fine. However when I pass a <code>QT::Key_Enter</code> which is supposed to press the OK button of the currently active window, or <code>QT::Key_Cancel</code> for the cancel button, it does nothing. </p>
  
  <p>I'm thinking maybe, because these buttons don't have the focus, and the parent window itself has it. How do you get the children of a window? or rather find the OK or Cancel button on it so you could set it as the activeWindow and then pass KeyPresses successfully?</p>
  
  <p>I have: </p>
  
  <pre><code>QWidget *pWin = QApplication::activeWindow;
  QObjectList *pList = pWin-&gt;children();
  //how do you iterate through the list and find the OK or Cancel button?
  </code></pre>