Hello!

I have a problem with a QMenuBar. It doesn't show up properly. Instead of all the QMenu and QAction inside it, it only shows a ">>" symbol like this:
menu.jpg

I can press the symbol and a menu of menus shows up and everything works fine. But this is still a problem. I tried playing around with the size of the widget the QMenuBar is inside, removed all relevant style sheet entries and reduced the contents of the QMenuBar to a single QMenu with one QAction inside. Nothing helps. This happens only on one of two PCs where I tested it (Win XP does not work, Win7 works). The code to produce the menu looks like this:

Qt Code:
  1. // Build the menu bar.
  2. QMenuBar* menuBar = new QMenuBar();
  3. QHBoxLayout* menuLayout = new QHBoxLayout(ui.menuWidget);
  4. menuLayout->setMargin(0);
  5. menuLayout->addWidget(menuBar);
  6. menuLayout->addStretch(1);
  7. ui.menuWidget->setLayout(menuLayout);
  8.  
  9. QMenu* fileMenu = menuBar->addMenu(tr("&File"));
  10.  
  11. QAction* saveStateAction = fileMenu->addAction(tr("&Save State"));
  12. saveStateAction->setToolTip(tr("Saves the state history."));
  13. saveStateAction->setShortcut(QKeySequence(tr("Ctrl+S")));
  14. connect(saveStateAction, SIGNAL(triggered()), this, SLOT(saveStateHistory()));
  15.  
  16. // ...and more QMenus and QActions follow.
To copy to clipboard, switch view to plain text mode 


Any advice?

thanks,
Cruz