Re: QMenu and addAction problem
Hello there !
What is wrong with this code, i am confused:mad:
Code:
void QNotePad::createMenus()
{
QMenu *fileMenu
= menuBar
()->addMenu
("File");
m_newFileAction = fileMenu->addAction("New");
}
this function belongs to my MainWindow but when i run this code Qt says :
The program has unexpectedly finished.
/home/saeed/Documents/Qt Project/QNotePad-build-desktop/QNotePad exited with code 0
m_newFileAction is a QAction * data member.
Thanks
Added after 28 minutes:
i found it !;)
i had forgotten to insert QT+= gui core in my .pro file when i create new empty project