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

Method loadConfig

src/frontend/dockwidgets/XYCurveDock.cpp:1050–1087  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1048}
1049
1050void XYCurveDock::loadConfig(KConfig& config) {
1051 KConfigGroup group = config.group(QStringLiteral("XYCurve"));
1052
1053 // General
1054 // we don't load/save the settings in the general-tab, since they are not style related.
1055 // It doesn't make sense to load/save them in the template.
1056 // This data is read in XYCurveDock::setCurves().
1057
1058 // Line
1059 bool xyCurve = (m_curve->type() == AspectType::XYCurve);
1060 if (xyCurve) {
1061 ui.cbLineType->setCurrentIndex(group.readEntry(QStringLiteral("LineType"), (int)m_curve->lineType()));
1062 ui.chkLineSkipGaps->setChecked(group.readEntry(QStringLiteral("LineSkipGaps"), m_curve->lineSkipGaps()));
1063 ui.sbLineInterpolationPointsCount->setValue(group.readEntry(QStringLiteral("LineInterpolationPointsCount"), m_curve->lineInterpolationPointsCount()));
1064 }
1065 lineWidget->loadConfig(group);
1066 dropLineWidget->loadConfig(group);
1067
1068 // Symbols
1069 symbolWidget->loadConfig(group);
1070
1071 // Values
1072 ui.cbValuesType->setCurrentIndex(group.readEntry(QStringLiteral("ValuesType"), (int)m_curve->valuesType()));
1073 ui.cbValuesPosition->setCurrentIndex(group.readEntry(QStringLiteral("ValuesPosition"), (int)m_curve->valuesPosition()));
1074 ui.sbValuesDistance->setValue(
1075 Worksheet::convertFromSceneUnits(group.readEntry(QStringLiteral("ValuesDistance"), m_curve->valuesDistance()), Worksheet::Unit::Point));
1076 ui.sbValuesRotation->setValue(group.readEntry(QStringLiteral("ValuesRotation"), m_curve->valuesRotationAngle()));
1077 ui.sbValuesOpacity->setValue(std::round(group.readEntry(QStringLiteral("ValuesOpacity"), m_curve->valuesOpacity()) * 100.0));
1078 ui.leValuesPrefix->setText(group.readEntry(QStringLiteral("ValuesPrefix"), m_curve->valuesPrefix()));
1079 ui.leValuesSuffix->setText(group.readEntry(QStringLiteral("ValuesSuffix"), m_curve->valuesSuffix()));
1080 QFont valuesFont = m_curve->valuesFont();
1081 valuesFont.setPointSizeF(std::round(Worksheet::convertFromSceneUnits(valuesFont.pointSizeF(), Worksheet::Unit::Point)));
1082 ui.kfrValuesFont->setFont(group.readEntry(QStringLiteral("ValuesFont"), valuesFont));
1083 ui.kcbValuesColor->setColor(group.readEntry(QStringLiteral("ValuesColor"), m_curve->valuesColor()));
1084
1085 // Filling
1086 backgroundWidget->loadConfig(group);
1087}
1088
1089void XYCurveDock::saveConfigAsTemplate(KConfig& config) {
1090 KConfigGroup group = config.group(QStringLiteral("XYCurve"));

Callers 1

Calls 8

lineTypeMethod · 0.80
groupMethod · 0.45
typeMethod · 0.45
setCurrentIndexMethod · 0.45
setValueMethod · 0.45
setTextMethod · 0.45
setFontMethod · 0.45
setColorMethod · 0.45

Tested by

no test coverage detected