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

Method loadThemeConfig

src/backend/worksheet/plots/cartesian/RunChart.cpp:508–532  ·  view source on GitHub ↗

############################################################################## ######################### Theme management ################################## ##############################################################################

Source from the content-addressed store, hash-verified

506// ######################### Theme management ##################################
507// ##############################################################################
508void RunChart::loadThemeConfig(const KConfig& config) {
509 KConfigGroup group;
510 if (config.hasGroup(QStringLiteral("Theme")))
511 group = config.group(QStringLiteral("XYCurve")); // when loading from the theme config, use the same properties as for XYCurve
512 else
513 group = config.group(QStringLiteral("RunChart"));
514
515 Q_D(RunChart);
516 const auto* plot = d->m_plot;
517 int index = plot->curveChildIndex(this);
518 QColor themeColor = plot->themeColorPalette(index);
519
520 d->suppressRecalc = true;
521
522 d->dataCurve->line()->loadThemeConfig(group, themeColor);
523 d->dataCurve->symbol()->loadThemeConfig(group, themeColor);
524
525 themeColor = plot->themeColorPalette(index + 1);
526
527 d->centerCurve->line()->loadThemeConfig(group, themeColor);
528 d->centerCurve->symbol()->setStyle(Symbol::Style::NoSymbols);
529
530 d->suppressRecalc = false;
531 d->recalcShapeAndBoundingRect();
532}
533
534void RunChart::saveThemeConfig(const KConfig& config) {
535 Q_D(const RunChart);

Callers

nothing calls this directly

Calls 7

curveChildIndexMethod · 0.80
groupMethod · 0.45
themeColorPaletteMethod · 0.45
lineMethod · 0.45
symbolMethod · 0.45
setStyleMethod · 0.45

Tested by

no test coverage detected