Basic QMainWindow doesn't show menubar
Hi Guys
I've just started with QT and have created a QMainWindow in QT Designer. I've added several menuItems with actions to the menubar.
I then create a subclass (MainWindow) inheriting from Ui::MainWindow and QMainWindow.
Then in main, I create MainWindow and show it.
Compiles fine and runs but only shows the mainWindow without the menubar.
Am running Leopard on a Mac.
What might I be doing wrong?
Jeff
Re: Basic QMainWindow doesn't show menubar
I had this problem I'm also a beginner, adding the snippet of code shown below on the constructor in the mainwindow.cpp file solved it for me.
Code:
MainWindowImpl
::MainWindowImpl( QWidget * parent, Qt
::WFlags f
) {
setupUi(this); // required so menus appear only window w/o it
Re: Basic QMainWindow doesn't show menubar
Quote:
Originally Posted by
Jeffb
Am running Leopard on a Mac.
On Macs the menu bar is on top of the screen and not in the window.