title: Need help on Event handling to signalling in QTcreator
body: <p>So basically what I am trying to do is the following:
  I want to create a directional arrows pad on the screen. When the user presses the up or 8 key, the UI should react as if I clicked the up button. I have googled and searched all over, but as I just started using QTCreator (and C++), I am very inexperienced and any help would be appreciated.</p>
  
  <p>So far I have</p>
  
  <pre><code>class GamePadWidget : public QWidget
      {
      public:
          GamePadWidget(QWidget *parent = 0);
  
      protected:
          virtual void keyPressEvent(QKeyEvent *event);
  
      };
  GamePadWidget::GamePadWidget(QWidget *parent)
      : QWidget(parent)
  {
  
      int buttonWidth = 75;
      int buttonHeight = 75;
  
      QPushButton *down = new QPushButton(("Y-"), this);;
      down-&gt;setGeometry(100, 200, 100, 100);
      QIcon downicon;
      downicon.addFile(QString::fromUtf8("C:/arrows/Aiga_downarrow.png"), QSize(),QIcon::Normal, QIcon::Off);
      down-&gt;setIcon(downicon);
      down-&gt;setIconSize(QSize(buttonWidth,buttonHeight));
      down-&gt;setFocusPolicy(Qt::NoFocus);
  
      QPushButton *up = new QPushButton(("Y+"), this);;
      up-&gt;setGeometry(100, 50, 100, 100);
      QIcon upicon;
      upicon.addFile(QString::fromUtf8("C:/arrows/Aiga_uparrow.png"), QSize(),QIcon::Normal, QIcon::Off);
      up-&gt;setIcon(upicon);
      up-&gt;setIconSize(QSize(buttonWidth,buttonHeight));
      up-&gt;setFocusPolicy(Qt::NoFocus);
  
  }
  void GamePadWidget::keyPressEvent(QKeyEvent *event)
  {
      if (event-&gt;key() == Qt::Key_8 || event-&gt;key() == Qt::Key_Up ) {
          printf("key event in board");
  
     }
  
     else if (event-&gt;key() == Qt::Key_9 || event-&gt;key() == Qt::Key_Down ) {
           qApp-&gt;quit();
  
      }
  }
  
  int main(int argc, char *argv[])
   {
       QApplication app(argc, argv);
       GamePadWidget widget;
       widget.show();
       return app.exec();
   }
  </code></pre>
  
  <p>with my current code, if I press down or 2, the app exits as expected, yet here is part in which I am stuck at.</p>
  
  <p>I want the same functionality as if I pressed the down (or up key), the pushbutton should light up briefly then shoot off a signal to who knows where</p>
  
  <p>I realize it should have something to do with connect(quit, SIGNAL(clicked()), qApp, SLOT(quit()));</p>
  
  <p>but cannot quite wrap my mind / find it.</p>
  
  <p>Thank you for your time.</p>