title: QShortcut not working
body: <p>I can't seem to get my keyboard shortcut working. Here is the code:</p>
  
  <pre><code>class Interface : public QObject 
  {
      Q_OBJECT
  
      private:
  
      QMainWindow myWindow;
      QWidget mainWidget;
      QShortcut shortcut;
  
      public:
  
      Interface();
      ~Interface();
      void show(void);
  
      public slots:
  
      void haha(void);
  };
  
  Interface::Interface() : 
      QObject(),
      shortcut(QKeySequence(Qt::Key_Enter), &amp;mainWidget)
  {
      myWindow.setFixedSize(1200, 600);
      myWindow.setCentralWidget(&amp;mainWidget);
      QObject::connect(&amp;shortcut, SIGNAL(activated()), this, SLOT(haha()));
  }
  
  void Interface::show(void)
  {
      myWindow.show();
  }
  
  void Interface::haha(void)
  {
      std::cout &lt;&lt; "foo" &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>My main function is:</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      QApplication app(argc, argv);
      QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
      QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
  
      Interface myInterface;
      myInterface.Show();
      return app.exec();
  }
  </code></pre>
  
  <p>It compiles without any warning/error, but when I execute it, no "foo" is printed when I press Enter. I've looked up the Internet already but I didn't find something close enough. I'm sorry if I missed something relevant.</p>