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

Method loadConfig

src/frontend/dockwidgets/WorksheetDock.cpp:615–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613}
614
615void WorksheetDock::loadConfig(KConfig& config) {
616 KConfigGroup group = config.group(QStringLiteral("Worksheet"));
617
618 // Geometry
619 ui.chScaleContent->setChecked(group.readEntry(QStringLiteral("ScaleContent"), false));
620 ui.sbWidth->setValue(Worksheet::convertFromSceneUnits(roundSceneValue(group.readEntry(QStringLiteral("Width"), m_worksheet->pageRect().width()), m_units), m_worksheetUnit));
621 ui.sbHeight->setValue(Worksheet::convertFromSceneUnits(roundSceneValue(group.readEntry(QStringLiteral("Height"), m_worksheet->pageRect().height()), m_units), m_worksheetUnit));
622 if (group.readEntry(QStringLiteral("UseViewSize"), false))
623 ui.cbSizeType->setCurrentIndex(0);
624 else
625 updatePaperSize();
626
627 // Background
628 backgroundWidget->loadConfig(group);
629
630 // Layout
631 ui.cbLayout->setCurrentIndex(group.readEntry(QStringLiteral("Layout"), (int)m_worksheet->layout()));
632 ui.sbLayoutTopMargin->setValue(
633 Worksheet::convertFromSceneUnits(roundSceneValue(group.readEntry(QStringLiteral("LayoutTopMargin"), m_worksheet->layoutTopMargin()), m_units), m_worksheetUnit));
634 ui.sbLayoutBottomMargin->setValue(
635 Worksheet::convertFromSceneUnits(roundSceneValue(group.readEntry(QStringLiteral("LayoutBottomMargin"), m_worksheet->layoutBottomMargin()), m_units), m_worksheetUnit));
636 ui.sbLayoutLeftMargin->setValue(
637 Worksheet::convertFromSceneUnits(roundSceneValue(group.readEntry(QStringLiteral("LayoutLeftMargin"), m_worksheet->layoutLeftMargin()), m_units), m_worksheetUnit));
638 ui.sbLayoutRightMargin->setValue(
639 Worksheet::convertFromSceneUnits(roundSceneValue(group.readEntry(QStringLiteral("LayoutRightMargin"), m_worksheet->layoutRightMargin()), m_units), m_worksheetUnit));
640 ui.sbLayoutHorizontalSpacing->setValue(
641 Worksheet::convertFromSceneUnits(roundSceneValue(group.readEntry(QStringLiteral("LayoutHorizontalSpacing"), m_worksheet->layoutHorizontalSpacing()), m_units), m_worksheetUnit));
642 ui.sbLayoutVerticalSpacing->setValue(
643 Worksheet::convertFromSceneUnits(roundSceneValue(group.readEntry(QStringLiteral("LayoutVerticalSpacing"), m_worksheet->layoutVerticalSpacing()), m_units), m_worksheetUnit));
644
645 ui.sbLayoutRowCount->setValue(group.readEntry(QStringLiteral("LayoutRowCount"), m_worksheet->layoutRowCount()));
646 ui.sbLayoutColumnCount->setValue(group.readEntry(QStringLiteral("LayoutColumnCount"), m_worksheet->layoutColumnCount()));
647}
648
649void WorksheetDock::saveConfigAsTemplate(KConfig& config) {
650 KConfigGroup group = config.group(QStringLiteral("Worksheet"));

Callers 1

Calls 6

heightMethod · 0.80
groupMethod · 0.45
setValueMethod · 0.45
widthMethod · 0.45
pageRectMethod · 0.45
setCurrentIndexMethod · 0.45

Tested by

no test coverage detected