QMenuBar* menuBar = new QMenuBar(this);QAction* act1;act1 = menuBar->addAction("act 1");connect(act1, SIGNAL(triggered()), this, SLOT(my1()));QAction* act2;act2 = menuBar->addAction("act 2");connect(act2, SIGNAL(triggered()), this, SLOT(my2()));
QMenuBar* menuBar = new QMenuBar(this);QMenu * myMenu = new QMenu();myMenu->setTitle("Settings");menuBar->addMenu(myMenu);QAction* act1;act1 = menuBar->addAction("act 1");connect(act1, SIGNAL(triggered()), this, SLOT(my1()));QAction* act2;act2 = menuBar->addAction("act 2");connect(act2, SIGNAL(triggered()), this, SLOT(my2()));