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

Method createContextMenu

src/backend/worksheet/plots/cartesian/CartesianPlot.cpp:771–794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

769}
770
771QMenu* CartesianPlot::createContextMenu() {
772 if (!m_menusInitialized)
773 initMenus();
774
775 QMenu* menu = WorksheetElement::createContextMenu();
776 // seems to be a bug, because the tooltips are not shown
777 menu->setToolTipsVisible(true);
778 QAction* visibilityAction = this->visibilityAction();
779
780 menu->insertMenu(visibilityAction, m_addNewMenu);
781 menu->insertSeparator(visibilityAction);
782 menu->insertMenu(visibilityAction, themeMenu);
783 menu->insertSeparator(visibilityAction);
784
785 if (children<XYCurve>().isEmpty()) {
786 addInfoElementAction->setEnabled(false);
787 addInfoElementAction->setToolTip(i18n("No curves inside the plot area."));
788 } else {
789 addInfoElementAction->setEnabled(true);
790 addInfoElementAction->setToolTip(QString());
791 }
792
793 return menu;
794}
795
796QMenu* CartesianPlot::addNewMenu() {
797 if (!m_menusInitialized)

Callers 1

contextMenuEventMethod · 0.45

Calls 5

visibilityActionMethod · 0.80
setToolTipMethod · 0.80
QStringClass · 0.50
isEmptyMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected