Hi Guys,
I am having little problem with QMenubar on QMainWindow. I have been using Qt4. I have couple QActions and menus added to menubar. I am able to access all action slots such as ( Ctl+N) New or Clt+S (Save) that have added to menubar in normal window screen. But as soon as I switched to full screen mode and I am not able to get actions to working (Ctl+N or CLT+S) . Because I beleive QMenubar is part of mainwindow and actions are added on top of that to menuBar. Is there any way to access menuItems from menubar even it is hidden in full screen mode? It works fine in Qt3.
Here's the code snippet:-
mainWindow is QMainWindow
QMenuBar * pMenuBar = mainWindow->menuBar();
void CMainClass::ToggleSlot()
{
if(mainWindow->windowState() & Qt::WindowFullScreen) // Show normal
{
if(pMenuBar)
{
m_pMenuBar->show(); //Everything works fine
}
}
else //Show FullScreen
{
if(pMenuBar)
{
m_pMenuBar->hide(); //Unable to acces menu items
}
}
mainWindow->setWindowState( mainWindow->windowState() ^Qt::WindowFullScreen );
}
void CMainClass::ToggleSlot()
{
if(mainWindow->windowState() & Qt::WindowFullScreen) // Show normal
{
if(pMenuBar)
{
m_pMenuBar->show(); //Everything works fine
}
}
else //Show FullScreen
{
if(pMenuBar)
{
m_pMenuBar->hide(); //Unable to acces menu items
}
}
mainWindow->setWindowState( mainWindow->windowState() ^Qt::WindowFullScreen );
}
To copy to clipboard, switch view to plain text mode
Bookmarks