title: In a QWizard, the next button cannot accept key press event, but accepts mouse press event?
body: <p>I have a class inherits QWizard, and add 2 independent QWizardPage(s). Before go to the next page, I want to do some job (i.e. check internet connection) on the first page. User may click 'next' button by mouse, or directly press enter/return by keyboard since the 'next' button is focused by default. So I install a eventfilter for the button:</p>
  
  <p><strong>button(QWizard::NextButton)->installEventFilter(this);</strong></p>
  
  <p>Then in the wizard class implement the event handling code:</p>
  
  <pre><code>bool MyWizard::eventFilter(QObject *watched, QEvent *event)
  {
      if (watched == button(QWizard::NextButton))
      {
          if (currentId() == startPageId)
          {
              if (event-&gt;type() == QEvent::KeyPress)
              {
                  QKeyEvent *keyEvent = static_cast&lt;QKeyEvent *&gt;(event);
                  if (keyEvent-&gt;key() == Qt::Key_Return || keyEvent-&gt;key() == Qt::Key_Enter)
                  {
                      // Do something. Cannot be reached.
                  }
              }
              else if (event-&gt;type() == QEvent::MouseButtonPress)
              {
                  // Do something. Can be reached.
              }
          }
      }    
      return QWizard::eventFilter(watched, event);
  }
  </code></pre>
  
  <p>As I tried many times, clicking mouse can always make my event processing code run, but pressing key makes nothing to do. Another curious thing is, press mouse on button without releasing, then move away and release, the wizard stays on first page, now I can press key and all that is OK.</p>
  
  <p>Could any one help to find the reason, is that a Qt bug? how can I make the key event work properly?   </p>