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

Method load

src/frontend/dockwidgets/ReferenceLineDock.cpp:190–220  ·  view source on GitHub ↗

SETTINGS

Source from the content-addressed store, hash-verified

188//******************** SETTINGS ****************************
189//**********************************************************
190void ReferenceLineDock::load() {
191 if (!m_line)
192 return;
193
194 // No lock!
195
196 auto orientation = m_line->orientation();
197 ui.cbOrientation->setCurrentIndex(static_cast<int>(orientation));
198 updateWidgetsOrientation(orientation);
199
200 // position
201 const auto* plot = static_cast<const CartesianPlot*>(m_line->plot());
202 if (orientation == ReferenceLine::Orientation::Horizontal) {
203 if (plot->yRangeFormatDefault() == RangeT::Format::Numeric)
204 ui.sbPosition->setValue(m_line->positionLogical().y());
205 else { // DateTime
206 ui.dtePosition->setDisplayFormat(plot->rangeDateTimeFormat(Dimension::Y));
207 ui.dtePosition->setMSecsSinceEpochUTC(m_line->positionLogical().y());
208 }
209 } else {
210 if (plot->xRangeFormatDefault() == RangeT::Format::Numeric)
211 ui.sbPosition->setValue(m_line->positionLogical().x());
212 else { // DateTime
213 ui.dtePosition->setDisplayFormat(plot->rangeDateTimeFormat(Dimension::X));
214 ui.dtePosition->setMSecsSinceEpochUTC(m_line->positionLogical().x());
215 }
216 }
217
218 ui.chbLock->setChecked(m_line->isLocked());
219 ui.chkVisible->setChecked(m_line->isVisible());
220}
221
222void ReferenceLineDock::loadConfigFromTemplate(KConfig& config) {
223 auto name = TemplateHandler::templateName(config);

Callers 1

setReferenceLinesMethod · 0.95

Calls 11

yRangeFormatDefaultMethod · 0.80
rangeDateTimeFormatMethod · 0.80
setMSecsSinceEpochUTCMethod · 0.80
xRangeFormatDefaultMethod · 0.80
xMethod · 0.80
orientationMethod · 0.45
setCurrentIndexMethod · 0.45
plotMethod · 0.45
setValueMethod · 0.45
yMethod · 0.45
isVisibleMethod · 0.45

Tested by

no test coverage detected