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

Method initActions

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

Source from the content-addressed store, hash-verified

407}
408
409void CartesianPlot::initActions() {
410 // analysis curves, no icons yet
411 addDataReductionCurveAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-curve")), i18n("Data Reduction"), this);
412 addDifferentiationCurveAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-curve")), i18n("Differentiation"), this);
413 addIntegrationCurveAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-curve")), i18n("Integration"), this);
414 addInterpolationCurveAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-interpolation-curve")), i18n("Interpolation"), this);
415 addSmoothCurveAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-smoothing-curve")), i18n("Smooth"), this);
416 addFitCurveAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-fit-curve")), i18nc("Curve fitting", "Fit"), this);
417 addFourierFilterCurveAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-fourier-filter-curve")), i18n("Fourier Filter"), this);
418 addFourierTransformCurveAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-fourier-transform-curve")), i18n("Fourier Transform"), this);
419 addHilbertTransformCurveAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-curve")), i18n("Hilbert Transform"), this);
420 addConvolutionCurveAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-curve")), i18n("(De-)Convolution"), this);
421 addCorrelationCurveAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-curve")), i18n("Auto-/Cross-Correlation"), this);
422
423 connect(addDataReductionCurveAction, &QAction::triggered, this, &CartesianPlot::addDataReductionCurve);
424 connect(addDifferentiationCurveAction, &QAction::triggered, this, &CartesianPlot::addDifferentiationCurve);
425 connect(addIntegrationCurveAction, &QAction::triggered, this, &CartesianPlot::addIntegrationCurve);
426 connect(addInterpolationCurveAction, &QAction::triggered, this, &CartesianPlot::addInterpolationCurve);
427 connect(addSmoothCurveAction, &QAction::triggered, this, &CartesianPlot::addSmoothCurve);
428 connect(addFitCurveAction, &QAction::triggered, this, &CartesianPlot::addFitCurve);
429 connect(addFourierFilterCurveAction, &QAction::triggered, this, &CartesianPlot::addFourierFilterCurve);
430 connect(addFourierTransformCurveAction, &QAction::triggered, this, [=]() {
431 addChild(new XYFourierTransformCurve(i18n("Fourier Transform")));
432 });
433 connect(addHilbertTransformCurveAction, &QAction::triggered, this, [=]() {
434 addChild(new XYHilbertTransformCurve(i18n("Hilbert Transform")));
435 });
436 connect(addConvolutionCurveAction, &QAction::triggered, this, [=]() {
437 addChild(new XYConvolutionCurve(i18n("Convolution")));
438 });
439 connect(addCorrelationCurveAction, &QAction::triggered, this, [=]() {
440 addChild(new XYCorrelationCurve(i18n("Auto-/Cross-Correlation")));
441 });
442
443 addFunctionCurveAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-equation-curve")), i18n("Function"), this);
444 addFunctionCurveAction->setToolTip(i18n("Add a new xy-curve that is defined as a function of other xy-curves (scaled, shifted, etc.)"));
445 connect(addFunctionCurveAction, &QAction::triggered, this, &CartesianPlot::addFunctionCurve);
446
447 // Analysis menu actions, used in the spreadsheet
448 addDataReductionAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-curve")), i18n("Data Reduction"), this);
449 addDifferentiationAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-curve")), i18n("Differentiate"), this);
450 addIntegrationAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-curve")), i18n("Integrate"), this);
451 addInterpolationAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-interpolation-curve")), i18n("Interpolate"), this);
452 addSmoothAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-smoothing-curve")), i18n("Smooth"), this);
453 addConvolutionAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-curve")), i18n("Convolute/Deconvolute"), this);
454 addCorrelationAction = new QAction(QIcon::fromTheme(QStringLiteral("labplot-xy-curve")), i18n("Auto-/Cross-Correlation"), this);
455
456 QAction* fitAction = new QAction(i18n("Linear"), this);
457 fitAction->setData(static_cast<int>(XYAnalysisCurve::AnalysisAction::FitLinear));
458 addFitActions.append(fitAction);
459
460 fitAction = new QAction(i18n("Power"), this);
461 fitAction->setData(static_cast<int>(XYAnalysisCurve::AnalysisAction::FitPower));
462 addFitActions.append(fitAction);
463
464 fitAction = new QAction(i18n("Exponential (degree 1)"), this);
465 fitAction->setData(static_cast<int>(XYAnalysisCurve::AnalysisAction::FitExp1));
466 addFitActions.append(fitAction);

Callers

nothing calls this directly

Calls 5

setToolTipMethod · 0.80
appendMethod · 0.80
setDataMethod · 0.45
sizeMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected