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

Method updateWidgetsOrientation

src/frontend/dockwidgets/ReferenceLineDock.cpp:94–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void ReferenceLineDock::updateWidgetsOrientation(ReferenceLine::Orientation orientation) {
95 const auto* plot = static_cast<const CartesianPlot*>(m_line->plot());
96 bool numeric;
97 if (orientation == ReferenceLine::Orientation::Horizontal) {
98 ui.lPosition->setText(QStringLiteral("y:"));
99 ui.lPositionDateTime->setText(QStringLiteral("y:"));
100 numeric = (plot->yRangeFormatDefault() == RangeT::Format::Numeric);
101 } else {
102 ui.lPosition->setText(QStringLiteral("x:"));
103 ui.lPositionDateTime->setText(QStringLiteral("x:"));
104 numeric = (plot->xRangeFormatDefault() == RangeT::Format::Numeric);
105 }
106
107 ui.lPosition->setVisible(numeric);
108 ui.sbPosition->setVisible(numeric);
109 ui.lPositionDateTime->setVisible(!numeric);
110 ui.dtePosition->setVisible(!numeric);
111}
112
113//**********************************************************
114//*** SLOTs for changes triggered in ReferenceLineDock *****

Callers

nothing calls this directly

Calls 5

yRangeFormatDefaultMethod · 0.80
xRangeFormatDefaultMethod · 0.80
plotMethod · 0.45
setTextMethod · 0.45
setVisibleMethod · 0.45

Tested by

no test coverage detected