private void createMenus() { saveAsMenu = new QMenu(tr("&Save As"), this); for (QAction action : saveAsActs) saveAsMenu.addAction(action); fileMenu = new QMenu(tr("&File"), this); fileMenu.addAction(openAct); fileMenu.addMenu(saveAsMenu); fileMenu.addAction(printAct); fileMenu.addSeparator(); fileMenu.addAction(exitAct); optionMenu = new QMenu(tr("&Options"), this); optionMenu.addAction(penColorAct); optionMenu.addAction(penWidthAct); optionMenu.addSeparator(); optionMenu.addAction(clearScreenAct); helpMenu = new QMenu(tr("&Help"), this); helpMenu.addAction(aboutAct); helpMenu.addAction(aboutQtAct); menuBar().addMenu(fileMenu); menuBar().addMenu(optionMenu); menuBar().addMenu(helpMenu); }
private void createMenus() { fileMenu = menuBar().addMenu(tr("&File")); fileMenu.addAction(addImagesAct); fileMenu.addAction(removeAllImagesAct); fileMenu.addSeparator(); fileMenu.addAction(exitAct); viewMenu = menuBar().addMenu(tr("&View")); for (QAction action : styleActionGroup.actions()) viewMenu.addAction(action); viewMenu.addSeparator(); viewMenu.addAction(guessModeStateAct); menuBar().addSeparator(); helpMenu = menuBar().addMenu(tr("&Help")); helpMenu.addAction(aboutAct); helpMenu.addAction(aboutQtAct); }