title: QWidget how to receive keyPressEvent inside child widgets
body: <p>I have one main <code>Widget</code> and inside this main widget I have <code>QListWidget</code> and two buttons. I have override the <code>keyPressEvent</code> inside the main widget (inherited from <code>QWidget</code>). I can receive the <code>keyPress</code> events when focus is not on <code>QListWidget</code>, but when focus is inside the <code>QListWidget</code> I am unable to receive these <code>keyPress</code> events. Below is the code I have used to achieve this:</p>
  
  <pre><code>MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
  {
      ui-&gt;setupUi(this);
  
      this-&gt;setFocusPolicy(Qt::StrongFocus);
  
      ui-&gt;listWidget-&gt;addItem(new QListWidgetItem("Item1"));
      ui-&gt;listWidget-&gt;addItem(new QListWidgetItem("Item2"));
      ui-&gt;listWidget-&gt;addItem(new QListWidgetItem("Item3"));
  
  }
  
  MainWindow::~MainWindow()
  {
      delete ui;
  }
  
  void MainWindow::keyPressEvent(QKeyEvent *event)
  {
      qDebug() &lt;&lt; "event-&gt;key(): " &lt;&lt; event-&gt;key();
  
      QWidget::keyPressEvent(event);
  }
  </code></pre>