Hi all
i'm trying to make a simple GUI with QT 4.6. i made a separete class that represents the menu bar:
MenuBar::MenuBar()
{
aboutAct = new QAction(tr("&About QT"), this);
aboutAct->setStatusTip(tr("Show the application's About box"));
connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
quitAct = new QAction(tr("&Quit"),this);
quitAct->setStatusTip(tr("Exit to the program"));
//connect(quitAct, SIGNAL(triggered()), &QApp, SLOT(quit()));
menuFile = new QMenu("File");
menuFile->addAction(quitAct);
menuLinks = new QMenu("Links");
menuAbout = new QMenu("Info");
menuAbout->addAction(aboutAct);
addMenu(menuFile);
addMenu(menuLinks);
addMenu(menuAbout);
}
i can't connect the signal of the quitAct with the quit slot of the main application probably because it is not visible from the MenuBar class..
//connect(quitAct, SIGNAL(triggered()), &QApp, SLOT(quit()));
how can i do it?