I created a menu inside my mainwindow:
Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow)
  4. {
  5. ui->setupUi(this);
  6. Menu *settingsMenu = new Menu(this);
  7. // settingsMenu->show();
To copy to clipboard, switch view to plain text mode 

it works fine. But now I decided to create a menu class and add the menu creation code in that class.
the menu class I created also inherits QMainWindow. When I create an instance of it in the MainWindow constructor, it doesn't show anything.
of course if I call the show() method it will create it in a separate window.

How can I merge the menu class to the main window?

Qt Code:
  1. Menu::Menu(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow)
  4. {
  5. ui->setupUi(this);
  6.  
  7. createActions();
  8. createMenus();
  9. }
To copy to clipboard, switch view to plain text mode