Qt4: QMenuBar/QMenu doesn't show up on Mac OS X
- by Erick
Hello,
I'm having difficulties to make a QMenuBar display a QMenu with a QAction under Mac OS X (Snow Leopard).
Here is the code I'm using for creating the menu:
void ClientWindow::setUpMenu ()
{
QMenu * file = menuBar()->addMenu("&File");
QAction * quit = new QAction("&Quit", this);
file->addAction(quit);
connect(quit, SIGNAL(triggered()), this, SLOT(quit()));
}
Here is the ClientWindow class interface:
class ClientWindow : public QMainWindow
{
public:
ClientWindow (QWidget * parent = 0);
void setUpMenu ();
};
And here is my main() method:
int main (int argc, char * argv[])
{
QApplication app(argc, argv);
ClientWindow window;
window.setUpMenu();
window.show();
return app.exec();
}
Any ideas why it wouldn't show up on the menu bar?
Thank you all.