QT纯代码编写menubar、添加菜单栏
QMenu *optionMenu = menuBar()->addMenu( tr( "选项" ) ); //新建菜单栏 “选项”
optionMenu->addAction( newGame ); //菜单栏“选项”下添加newgame选项
optionMenu->addAction( exitGame );
newGame = new QAction( QIcon( ":/res/Icon.png"), tr( "New Game" ), this );
效果如图1:

菜单栏显示汉语、添加快捷键、添加图标
newGame = new QAction( QIcon( ":/res/Icon.png"), tr( "New Game" ), this );
newGame->setText("新游戏");
newGame->setShortcut(tr("Ctrl+P"));
exitGame->setText("退出");
新效果如下:

信号连接
connect( startGame, SIGNAL( triggered() ), this, SLOT( on_startGame() ) );
整体代码
newGame = new QAction( QIcon( ":/res/Icon.png"), tr( "New Game" ), this );
QMenu *optionMenu = menuBar()->addMenu( tr( "选项" ) );
optionMenu->addAction( newGame);
newGame->setText("新游戏");
newGame->setShortcut(tr("Ctrl+P"));
optionMenu->addAction( exitGame );
exitGame->setText("退出");
connect( startGame, SIGNAL( triggered() ), this, SLOT( on_startGame() ) );