Dont know why your application is crashing.. I tried the menu with QMenuBar pointer too... and its still working fine for me...
also from source code, menuBar creates a menubar if it doesnt exist..
{
QMenuBar *menuBar
= qobject_cast<QMenuBar
*>
(d_func
()->layout
->menuBar
());
if (!menuBar) {
self->setMenuBar(menuBar);
}
return menuBar;
}
QMenuBar *QMainWindow::menuBar() const
{
QMenuBar *menuBar = qobject_cast<QMenuBar *>(d_func()->layout->menuBar());
if (!menuBar) {
QMainWindow *self = const_cast<QMainWindow *>(this);
menuBar = new QMenuBar(self);
self->setMenuBar(menuBar);
}
return menuBar;
}
To copy to clipboard, switch view to plain text mode
I suggest one thing... catch the closEvent for your window... and trace back as to what caused it... it will give an idea why ur program is crashing...
by the way, by your crash, I guess it means ur application closes without any error ?? right ?
Bookmarks