Menubar stops working after it is hidden in full screen mode
-
When switching to full screen mode, we hide the menubar of main window with the code
menuBar()->hide();
Then the menu no longer works, so there is no way to switch back to the normal mode. How can I make menubar continue to work as it does in normal window mode? -
Did you use "setVisible":http://developer.qt.nokia.com/doc/qt-4.8/qmenubar.html#setVisible ?
-
Hi, my code looks like this:
@// private slot when user press F11 to switch between full screen and normal mode
void MainWindow::viewShowFullScreen()
{
static bool isToolboxVisible;if ( isFullScreen() ) {
showNormal();
// Show menubar, toolbar, status bar and other opened dialogs.
menuBar()->show();
fileToolBar->show();
editToolBar->show();
viewToolBar->show();
mainstatusBar->show();
if (isToolboxVisible)
sToolbox->show();
}
else {
showFullScreen();
// Hide menubar, toolbar, status bar and other opened dialogs.
menuBar()->hide();
fileToolBar->hide();
editToolBar->hide();
viewToolBar->hide();
mainstatusBar->hide();
isToolboxVisible = (sToolbox && sToolbox->isVisible());
if (isToolboxVisible)
sToolbox->hide();
}
}@ -
Please use code "tagging.":http://developer.qt.nokia.com/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 Otherwise your code section cannot be interpret.
You might want to check "setVisible (true)":http://developer.qt.nokia.com/doc/qt-4.8/qwidget.html#visible-prop
May be that is working. -
Sorry I still do not quite follow. How to check setVisible(), which is equivalent to show().
-
It is just a test in case that there is a bug, which I doubt.
Are you sure that isFullScreen is returning true?
You may want to check this in the debugger. -
Yes, it returns true. If I comment out the line 20
menuBar()->hide();
the menubar works as normal. -
Is there anyone out there can fix this issue?