! * Populates the menu \c menu with the worksheet and worksheet view relevant actions. * The menu is used * - as the context menu in WorksheetView * - as the "worksheet menu" in the main menu-bar (called form MainWin) * - as a part of the worksheet context menu in project explorer */
| 568 | * - as a part of the worksheet context menu in project explorer |
| 569 | */ |
| 570 | void WorksheetView::createContextMenu(QMenu* menu) { |
| 571 | Q_ASSERT(menu != nullptr); |
| 572 | |
| 573 | if (!m_menusInitialized) |
| 574 | initMenus(); |
| 575 | |
| 576 | QAction* firstAction = nullptr; |
| 577 | // if we're populating the context menu for the project explorer, then |
| 578 | // there're already actions available there. Skip the first title-action |
| 579 | // and insert the action at the beginning of the menu. |
| 580 | if (menu->actions().size() > 1) |
| 581 | firstAction = menu->actions().at(1); |
| 582 | |
| 583 | menu->insertMenu(firstAction, m_addNewMenu); |
| 584 | menu->insertSeparator(firstAction); |
| 585 | menu->insertMenu(firstAction, m_viewMouseModeMenu); |
| 586 | menu->insertMenu(firstAction, m_zoomMenu); |
| 587 | menu->insertMenu(firstAction, m_magnificationMenu); |
| 588 | menu->insertSeparator(firstAction); |
| 589 | menu->insertMenu(firstAction, m_layoutMenu); |
| 590 | menu->insertMenu(firstAction, m_gridMenu); |
| 591 | menu->insertSeparator(firstAction); |
| 592 | menu->insertMenu(firstAction, m_themeMenu); |
| 593 | menu->insertSeparator(firstAction); |
| 594 | menu->insertAction(firstAction, plotsInteractiveAction); |
| 595 | menu->insertSeparator(firstAction); |
| 596 | menu->insertMenu(firstAction, m_cartesianPlotMenu); |
| 597 | menu->insertSeparator(firstAction); |
| 598 | menu->insertAction(firstAction, showPresenterMode); |
| 599 | menu->insertSeparator(firstAction); |
| 600 | } |
| 601 | |
| 602 | void WorksheetView::fillToolBar(QToolBar* toolBar) { |
| 603 | toolBar->addSeparator(); |
no test coverage detected