title: Why does this slot get called twice?
body: <p>My problem is that when I click on an item in a QMenuBar, the corresponding slot gets called twice. I'm using Qt 4.8.1. I'm not using Qt Designer nor the "auto-connection" feature. Here is my code snippet :</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;QWidget&gt;
  #include &lt;QMenuBar&gt;
  
  class MyWidget : public QWidget
  {
          Q_OBJECT
          public:
                  MyWidget(QWidget *parent = 0) : QWidget(parent)
                  {
                          QMenuBar *menu = new QMenuBar(this);
                          menu-&gt;addAction("Click here");
                          menu-&gt;addAction("Or here");
                          connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(handleAction(QAction*)));
                  }
  
          public slots:
                  void handleAction(QAction *action)
                  {
                          std::cout &lt;&lt; "Triggered" &lt;&lt; std::endl;
                  }
  
  };
  </code></pre>
  
  <p>And the main function :</p>
  
  <pre><code>#include "main.h"
  #include &lt;QApplication&gt;
  
  int main(int argc, char **argv)
  {
      QApplication app(argc, argv);
      MyWidget w;
      w.show();
  
      return app.exec();
  }
  </code></pre>
  
  <p>If you compile this (with the MOC file), you'll see that clicking on "Click here" will print "Triggered" once, and "Or here" twice. I don't understand why.</p>
  
  <p>What am I doing wrong ?</p>