title: Qt Mainwindow menu signals
body: <p>I've "Core" object that handles QMainWindow.<br>
  Core.h code  </p>
  
  <pre><code>class Core : public QObject
  {
      Q_OBJECT
  public:
      explicit Core(QObject *parent = 0);
      ~Core();
      void appInit();
      int getAuth();
  
  public slots:
      void appExit();
  
  private slots:
      void appMenuTriggered(QAction *action);
  
  private:
      void preInit();
      MainWindow *mwnd;
  };
  </code></pre>
  
  <p>Core.cpp code</p>
  
  <pre><code>Core::Core(QObject *parent) : QObject(parent)
  {
      qDebug() &lt;&lt; "Core::Constructor called";
      preInit();
  }
  
  Core::~Core()
  {
      delete mwnd;
      qDebug() &lt;&lt; "Core::Destructor called";
  }
  
  int Core::getAuth()
  {
      LoginDialog *login = new LoginDialog();
      int r = login-&gt;exec();
      delete login;
      return r;
  }
  
  void Core::appExit() // connected to qapplication aboutToQuit
  {
      qDebug() &lt;&lt; "Core::appExit called";
  }
  
  void Core::preInit()  // called after getAuth im main.cpp
  {
      qDebug() &lt;&lt; "Core::preInit called";
  }
  
  void Core::appMenuTriggered( QAction *action )
  {
      qDebug() &lt;&lt; "action triggered";
  }
  
  void Core::appInit()
  {
      mwnd = new MainWindow();
      mwnd-&gt;show();
      qDebug() &lt;&lt; "Core::appInit called";
  }
  </code></pre>
  
  <p>I'm trying to connect mainwindow menubar signal to core slot like this:</p>
  
  <pre><code>connect(mwnd-&gt;menuBar(), SIGNAL(triggered()), this, SLOT(appMenuTriggered()));
  </code></pre>
  
  <p>But it doesn't work. Im new to c++ and Qt. How to connect this?
  Or maybe there is better way to handle mainwindow actions to other programm parts.</p>
  
  <p><strong>UPD</strong>
    Problem solved. Forget to include QMenuBar</p>