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

Method loadConfig

src/frontend/widgets/BackgroundWidget.cpp:421–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421void BackgroundWidget::loadConfig(const KConfigGroup& group) {
422 ui.cbType->setCurrentIndex(group.readEntry(m_prefix + QStringLiteral("Type"), (int)m_background->type()));
423 ui.cbColorStyle->setCurrentIndex(group.readEntry(m_prefix + QStringLiteral("ColorStyle"), (int)m_background->colorStyle()));
424 ui.cbImageStyle->setCurrentIndex(group.readEntry(m_prefix + QStringLiteral("ImageStyle"), (int)m_background->imageStyle()));
425 ui.cbBrushStyle->setCurrentIndex(group.readEntry(m_prefix + QStringLiteral("BrushStyle"), (int)m_background->brushStyle()));
426 ui.leFileName->setText(group.readEntry(m_prefix + QStringLiteral("FileName"), m_background->fileName()));
427 ui.kcbFirstColor->setColor(group.readEntry(m_prefix + QStringLiteral("FirstColor"), m_background->firstColor()));
428 ui.kcbSecondColor->setColor(group.readEntry(m_prefix + QStringLiteral("SecondColor"), m_background->secondColor()));
429 ui.sbOpacity->setValue(std::round(group.readEntry(m_prefix + QStringLiteral("Opacity"), m_background->opacity()) * 100));
430
431 // optional parameters
432 if (m_background->enabledAvailable())
433 ui.chkEnabled->setChecked(group.readEntry(m_prefix + QStringLiteral("Enabled"), m_background->enabled()));
434
435 if (m_background->positionAvailable())
436 ui.cbPosition->setCurrentIndex(group.readEntry(m_prefix + QStringLiteral("Position"), (int)m_background->position()));
437}
438
439void BackgroundWidget::saveConfig(KConfigGroup& group) const {
440 group.writeEntry(m_prefix + QStringLiteral("Type"), ui.cbType->currentIndex());

Callers

nothing calls this directly

Calls 8

enabledMethod · 0.80
positionMethod · 0.80
setCurrentIndexMethod · 0.45
typeMethod · 0.45
setTextMethod · 0.45
fileNameMethod · 0.45
setColorMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected