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

Method bindingChanged

src/frontend/widgets/LabelWidget.cpp:1139–1174  ·  view source on GitHub ↗

! * \brief LabelWidget::bindingChanged * Bind TextLabel to the cartesian plot coords or not * \param checked */

Source from the content-addressed store, hash-verified

1137 * \param checked
1138 */
1139void LabelWidget::bindingChanged(bool checked) {
1140 // widgets for positioning using absolute plot distances
1141 ui.lPositionX->setVisible(!checked);
1142 ui.cbPositionX->setVisible(!checked);
1143 ui.sbPositionX->setVisible(!checked);
1144
1145 ui.lPositionY->setVisible(!checked);
1146 ui.cbPositionY->setVisible(!checked);
1147 ui.sbPositionY->setVisible(!checked);
1148
1149 // widgets for positioning using logical plot coordinates
1150 const auto* plot = static_cast<const CartesianPlot*>(m_label->parent(AspectType::CartesianPlot));
1151 if (plot && plot->xRangeFormatDefault() == RangeT::Format::DateTime) {
1152 ui.lPositionXLogicalDateTime->setVisible(checked);
1153 ui.dtePositionXLogical->setVisible(checked);
1154
1155 ui.lPositionXLogical->setVisible(false);
1156 ui.sbPositionXLogical->setVisible(false);
1157 } else {
1158 ui.lPositionXLogicalDateTime->setVisible(false);
1159 ui.dtePositionXLogical->setVisible(false);
1160
1161 ui.lPositionXLogical->setVisible(checked);
1162 ui.sbPositionXLogical->setVisible(checked);
1163 }
1164
1165 ui.lPositionYLogical->setVisible(checked);
1166 ui.sbPositionYLogical->setVisible(checked);
1167
1168 CONDITIONAL_LOCK_RETURN;
1169
1170 ui.chbBindLogicalPos->setChecked(checked);
1171
1172 for (auto* label : m_labelsList)
1173 label->setCoordinateBindingEnabled(checked);
1174}
1175
1176void LabelWidget::showPlaceholderTextChanged(bool checked) {
1177 CONDITIONAL_LOCK_RETURN;

Callers

nothing calls this directly

Calls 4

xRangeFormatDefaultMethod · 0.80
setVisibleMethod · 0.45
parentMethod · 0.45

Tested by

no test coverage detected