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

Method createContextMenu

src/backend/spreadsheet/Spreadsheet.cpp:711–726  ·  view source on GitHub ↗

! Returns a new context menu. The caller takes ownership of the menu. */

Source from the content-addressed store, hash-verified

709 Returns a new context menu. The caller takes ownership of the menu.
710*/
711QMenu* Spreadsheet::createContextMenu() {
712 QMenu* menu = AbstractPart::createContextMenu();
713 Q_ASSERT(menu);
714 if (type() != AspectType::StatisticsSpreadsheet)
715 Q_EMIT requestProjectContextMenu(menu);
716 else {
717 menu->addSeparator();
718 auto* action = new QAction(QIcon::fromTheme(QLatin1String("edit-delete")), i18n("Delete"), this);
719 connect(action, &QAction::triggered, this, [=]() {
720 auto* parentSpreadsheet = static_cast<Spreadsheet*>(parentAspect());
721 parentSpreadsheet->toggleStatisticsSpreadsheet(false);
722 });
723 menu->addAction(action);
724 }
725 return menu;
726}
727
728void Spreadsheet::fillColumnContextMenu(QMenu* menu, Column* column) {
729#ifndef SDK

Callers

nothing calls this directly

Calls 2

addSeparatorMethod · 0.80

Tested by

no test coverage detected