void MainWindow::createMenus() { createDatabaseMenu(); createTableMenu(); createIndexMenu(); createViewMenu(); createTriggerMenu(); createToolsMenu(); createHelpMenu(); }
void MainWindow::createToolBars() { webToolBar = addToolBar(tr("Web Tool Bar")); webToolBar->addAction(publishAct); editToolBar = addToolBar(tr("Edit Tool Bar")); editToolBar->addAction(undoAct); editToolBar->addAction(redoAct); QToolButton *editButton = new QToolButton(editToolBar); QMenu *editList = new QMenu(editButton); editList->addAction(cutAct); editList->addAction(copyAct); editList->addAction(pasteAct); editButton->setPopupMode(QToolButton::InstantPopup); editButton->setIcon(cutAct->icon()); editButton->setMenu(editList); editToolBar->addWidget(editButton); textToolBar = addToolBar(tr("Text Tool Bar")); secList = new HeadingComboBox(this); textToolBar->addWidget(secList); textToolBar->addAction(textBoldAct); textToolBar->addAction(textItalicAct); textToolBar->addAction(textUnderlineAct); textToolBar->addAction(textStrikeoutAct); textToolBar->addAction(textFontAct); textToolBar->addAction(textColorAct); textToolBar->addAction(textBackgroundColorAct); textToolBar->addSeparator(); if(QApplication::isLeftToRight()) { textToolBar->addAction(alignLeftAct); textToolBar->addAction(alignCenterAct); textToolBar->addAction(alignRightAct); } else { textToolBar->addAction(alignRightAct); textToolBar->addAction(alignCenterAct); textToolBar->addAction(alignLeftAct); } textToolBar->addAction(alignJustifyAct); textToolBar->addSeparator(); textToolBar->addAction(bulletListAct); textToolBar->addAction(numberedListAct); QToolButton *tableButton = new QToolButton(editToolBar); tableButton->setMenu(createTableMenu(tableButton)); tableButton->setPopupMode(QToolButton::InstantPopup); tableButton->setIcon(tableInsertAct->icon()); tableButton->setToolTip(tr("Table")); textToolBar->addWidget(tableButton); }
void MainWindow::createMenus() { QMenuBar *bar = this->menuBar(); QMenu *fileMenu = new QMenu(tr("&File"), bar); fileMenu->addAction(newPostAct); fileMenu->addAction(openPostAct); fileMenu->addAction(closePostAct); fileMenu->addSeparator(); fileMenu->addAction(savePostAct); fileMenu->addAction(saveAsPostAct); fileMenu->addSeparator(); fileMenu->addAction(exitAct); bar->addMenu(fileMenu); QMenu *editMenu = new QMenu(tr("&Edit"), bar); editMenu->addAction(undoAct); editMenu->addAction(redoAct); editMenu->addSeparator(); editMenu->addAction(cutAct); editMenu->addAction(copyAct); editMenu->addAction(pasteAct); bar->addMenu(editMenu); QMenu *formatMenu = new QMenu(tr("F&ormat"), bar); formatMenu->addAction(textFontAct); formatMenu->addAction(textColorAct); formatMenu->addAction(textBackgroundColorAct); formatMenu->addSeparator(); QMenu *alignMenu = new QMenu(tr("Alignment"), formatMenu); if(QApplication::isLeftToRight()) { alignMenu->addAction(alignLeftAct); alignMenu->addAction(alignCenterAct); alignMenu->addAction(alignRightAct); } else { alignMenu->addAction(alignRightAct); alignMenu->addAction(alignCenterAct); alignMenu->addAction(alignLeftAct); } alignMenu->addAction(alignJustifyAct); formatMenu->addMenu(alignMenu); bar->addMenu(formatMenu); QMenu *insertMenu = new QMenu(tr("&Insert"), bar); QMenu *listMenu = new QMenu(tr("List"), insertMenu); listMenu->addAction(bulletListAct); listMenu->addAction(numberedListAct); listMenu->addSeparator(); listMenu->addAction(indentMoreAct); listMenu->addAction(indentLessAct); insertMenu->addMenu(listMenu); QMenu *tableMenu = createTableMenu(insertMenu); insertMenu->addMenu(tableMenu); bar->addMenu(insertMenu); QMenu *toolMenu = new QMenu(tr("&Tools"), bar); toolMenu->addAction(pluginAct); bar->addMenu(toolMenu); bar->addSeparator(); QMenu *helpMenu = new QMenu(tr("Help"), bar); helpMenu->addAction(helpAct); helpMenu->addAction(aboutAct); bar->addMenu(helpMenu); }