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

Method load

src/frontend/widgets/BackgroundWidget.cpp:390–419  ·  view source on GitHub ↗

SETTINGS

Source from the content-addressed store, hash-verified

388//******************** SETTINGS ****************************
389//**********************************************************
390void BackgroundWidget::load() {
391 ui.cbType->setCurrentIndex((int)m_background->type());
392 ui.cbColorStyle->setCurrentIndex((int)m_background->colorStyle());
393 ui.cbImageStyle->setCurrentIndex((int)m_background->imageStyle());
394 ui.cbBrushStyle->setCurrentIndex((int)m_background->brushStyle());
395 ui.leFileName->setText(m_background->fileName());
396 ui.kcbFirstColor->setColor(m_background->firstColor());
397 ui.kcbSecondColor->setColor(m_background->secondColor());
398 ui.sbOpacity->setValue(std::round(m_background->opacity() * 100));
399
400 // optional parameters
401 bool visible = m_background->enabledAvailable();
402 ui.lEnabled->setVisible(visible);
403 ui.chkEnabled->setVisible(visible);
404
405 visible = m_background->positionAvailable();
406 ui.lPosition->setVisible(visible);
407 ui.cbPosition->setVisible(visible);
408
409 if (m_background->enabledAvailable())
410 ui.chkEnabled->setChecked(m_background->enabled());
411
412 if (m_background->enabledAvailable())
413 ui.cbPosition->setCurrentIndex((int)m_background->position());
414
415 // highlight the text field for the background image red if an image is used and cannot be found
416 const QString& fileName = m_background->fileName();
417 bool invalid = (!fileName.isEmpty() && !QFile::exists(fileName));
418 GuiTools::highlight(ui.leFileName, invalid);
419}
420
421void BackgroundWidget::loadConfig(const KConfigGroup& group) {
422 ui.cbType->setCurrentIndex(group.readEntry(m_prefix + QStringLiteral("Type"), (int)m_background->type()));

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected