MCPcopy Create free account
hub / github.com/KDE/labplot / createContextMenu

Method createContextMenu

src/frontend/worksheet/WorksheetView.cpp:570–600  ·  view source on GitHub ↗

! * 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 */

Source from the content-addressed store, hash-verified

568 * - as a part of the worksheet context menu in project explorer
569 */
570void 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
602void WorksheetView::fillToolBar(QToolBar* toolBar) {
603 toolBar->addSeparator();

Callers 2

contextMenuEventMethod · 0.45
contextMenuEventMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected