June 20, 2011

javiyt javiyt
Lab Rat
23 posts

Qt Menus

 

Hi, I have a couple of questions about the menus in Qt

Everytime I try to make a new Options menu the action “Show open apps.” is include by default. Is there any way to remove it?

The code is this

  1. QmlApplicationViewer viewer;
  2.  
  3. QMenu* m_menu;
  4. m_menu = new QMenu();
  5. m_menu->addAction("Exit", &app, SLOT(quit()));
  6.  
  7. QAction *optionsAction = new QAction("Options", &viewer);
  8. optionsAction->setSoftKeyRole(QAction::PositiveSoftKey);
  9. optionsAction->setMenu(m_menu);
  10. viewer.addAction(optionsAction);

The second question is about the action “exit”. Is there any way to hide instead of exit? I saw some applications (like ovi contacts) do it to keep running the application in background. I tried with viewer.hide and viewer.showMinimized but it doesn’t work.

Thanks in advance!

0 replies

 
  ‹‹ QDeclarativeItem::setParentItem      how to display multiple lines of text ››

You must log in to post a reply. Not a member yet? Register here!