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

Method load

src/frontend/dockwidgets/ReferenceRangeDock.cpp:230–263  ·  view source on GitHub ↗

SETTINGS

Source from the content-addressed store, hash-verified

228//******************** SETTINGS ****************************
229//**********************************************************
230void ReferenceRangeDock::load() {
231 if (!m_range)
232 return;
233
234 auto orientation = m_range->orientation();
235 ui.cbOrientation->setCurrentIndex(static_cast<int>(orientation));
236 orientationChanged(ui.cbOrientation->currentIndex()); // call this to update the position widgets that depend on the orientation
237
238 // position
239 const auto* plot = static_cast<const CartesianPlot*>(m_range->plot());
240 if (orientation == ReferenceRange::Orientation::Horizontal) {
241 if (plot->yRangeFormatDefault() == RangeT::Format::Numeric) {
242 ui.sbPositionStart->setValue(m_range->positionLogicalStart().y());
243 ui.sbPositionEnd->setValue(m_range->positionLogicalEnd().y());
244 } else { // DateTime
245 ui.dtePositionStart->setDisplayFormat(plot->rangeDateTimeFormat(Dimension::Y));
246 ui.dtePositionStart->setMSecsSinceEpochUTC(m_range->positionLogicalStart().y());
247 ui.dtePositionEnd->setDisplayFormat(plot->rangeDateTimeFormat(Dimension::Y));
248 ui.dtePositionEnd->setMSecsSinceEpochUTC(m_range->positionLogicalEnd().y());
249 }
250 } else {
251 if (plot->xRangeFormatDefault() == RangeT::Format::Numeric) {
252 ui.sbPositionStart->setValue(m_range->positionLogicalStart().x());
253 ui.sbPositionEnd->setValue(m_range->positionLogicalEnd().x());
254 } else { // DateTime
255 ui.dtePositionStart->setDisplayFormat(plot->rangeDateTimeFormat(Dimension::X));
256 ui.dtePositionStart->setMSecsSinceEpochUTC(m_range->positionLogicalStart().x());
257 ui.dtePositionEnd->setDisplayFormat(plot->rangeDateTimeFormat(Dimension::X));
258 ui.dtePositionEnd->setMSecsSinceEpochUTC(m_range->positionLogicalEnd().x());
259 }
260 }
261
262 ui.chkVisible->setChecked(m_range->isVisible());
263}

Callers 1

setReferenceRangesMethod · 0.95

Calls 12

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

Tested by

no test coverage detected