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

Method createContextMenu

src/frontend/workbook/WorkbookView.cpp:125–141  ·  view source on GitHub ↗

! * Populates the menu \c menu with the spreadsheet and spreadsheet view relevant actions. * The menu is used * - as the context menu in WorkbookView * - as the "spreadsheet menu" in the main menu-bar (called form MainWin) * - as a part of the spreadsheet context menu in project explorer */

Source from the content-addressed store, hash-verified

123 * - as a part of the spreadsheet context menu in project explorer
124 */
125void WorkbookView::createContextMenu(QMenu* menu) const {
126 Q_ASSERT(menu);
127
128 QAction* firstAction = nullptr;
129 // if we're populating the context menu for the project explorer, then
130 // there're already actions available there. Skip the first title-action
131 // and insert the action at the beginning of the menu.
132 if (menu->actions().size() > 1)
133 firstAction = menu->actions().at(1);
134
135 auto* addNewMenu = new QMenu(i18n("Add New"), const_cast<WorkbookView*>(this));
136 addNewMenu->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
137 addNewMenu->addAction(action_add_spreadsheet);
138 addNewMenu->addAction(action_add_matrix);
139 menu->insertMenu(firstAction, addNewMenu);
140 menu->insertSeparator(firstAction);
141}
142
143void WorkbookView::showTabContextMenu(QPoint point) {
144 QMenu* menu = nullptr;

Callers 1

showTabContextMenuMethod · 0.45

Calls 2

sizeMethod · 0.45
setIconMethod · 0.45

Tested by

no test coverage detected