title: QWidget keyPressEvent override
body: <p>I'm trying for half an eternity now overriding QWidgets keyPressEvent function in QT but it just won't work. I've to say i am new to CPP, but I know ObjC and standard C.</p>
  
  <p>My problem looks like this:</p>
  
  <pre><code>class QSGameBoard : public QWidget {
  Q_OBJECT
  
  public:
    QSGameBoard(QWidget *p, int w, int h, QGraphicsScene *s);
  
  signals:
    void keyCaught(QKeyEvent *e);
  
  protected:
    virtual void  keyPressEvent(QKeyEvent *event);
  };
  </code></pre>
  
  <p>QSGameBoard is my QWidget subclass and i need to override the keyPressEvent and fire a SIGNAL on each event to notify some registered objects.</p>
  
  <p>My overridden keyPressEvent in QSGameBoard.cpp looks like this:</p>
  
  <pre><code>void QSGameBoard::keyPressEvent(QKeyEvent *event) {
    printf("\nkey event in board: %i", event-&gt;key());
    //emit keyCaught(event);
  }
  </code></pre>
  
  <p>When i change QSGameBoard:: to QWidget:: it receives the events, but i cant emit the signal because the compiler complains about the scope. And if i write it like this the function doesn't get called at all.</p>
  
  <p>What's the problem here?</p>