title: PyQt keyPressEvent not triggered from QDialog
body: <p>I have a simple example of of a dialog window that has the <code>keyPressEvent</code> method. However, no matter what is typed when the sub window has focus, the event is not triggered.</p>
  
  <pre><code>import sys
  
  from PyQt4.QtCore import *
  from PyQt4.QtGui import *
  import PyQt4.Qt
  
  class KpeWindow(QDialog):
      def __init__(self, parent=None):
          super().__init__(parent)
          main = QVBoxLayout(self)
  
          label = QLabel(self)
          label.setText('Test the keyPressEvent')
  
          self.adjustSize()
          self.setLayout(main)
  
      def keyPressEvent(self, event):
          QMessageBox.warning(self, 'MDI', 'keyPressEvent')
          super().keyPressEvent(event)
  
  class MainWindow(QMainWindow):
      def __init__(self):
          super().__init__()
          self.setWindowTitle('KeyPressEvent Test')
          child = KpeWindow()
          self.setCentralWidget(child)
  
  if __name__ == '__main__':
      app = QApplication(sys.argv)
      mainWin = MainWindow()
      mainWin.show()
      sys.exit(app.exec_())
  </code></pre>