Segmentation fault while debugging in Toolbar creaton [solved]
-
I am trying to build MainWindow with some toolbars and menus. So in my mainwindow.h I have private variables QToolbar * filetBar; And in .cpp file, I am calling: createToolbars which is:
@
void MainWindow::createToolbars()
{
filetBar = addToolBar(tr("&File"));
filetBar->addAction(openAction);}
@
When I run, it just says The program has unexpectedly finished. When I run it with debugger is gives meSignal name : SIGSEGV Signal meaning : Segmentation fault ad line
@ filetBar->addAction(openAction); @
I create menus similarly:
@ void MainWindow::createMenus()
{
fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu->addAction(openAction);
}
@It show menus, and actions are working. Any idea how can I fix it? Thanks.
-
Hi,
Is openAction initialized ?
-
Hi,
I have found a bug, it is working,
Thanks. -
Glad you found out !
Then since it's working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)