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

Method bindingChanged

src/frontend/dockwidgets/ImageDock.cpp:339–374  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

337 * \param checked
338 */
339void ImageDock::bindingChanged(bool checked) {
340 // widgets for positioning using absolute plot distances
341 ui.lPositionX->setVisible(!checked);
342 ui.cbPositionX->setVisible(!checked);
343 ui.sbPositionX->setVisible(!checked);
344
345 ui.lPositionY->setVisible(!checked);
346 ui.cbPositionY->setVisible(!checked);
347 ui.sbPositionY->setVisible(!checked);
348
349 // widgets for positioning using logical plot coordinates
350 const auto* plot = static_cast<const CartesianPlot*>(m_image->parent(AspectType::CartesianPlot));
351 if (plot && plot->xRangeFormatDefault() == RangeT::Format::DateTime) {
352 ui.lPositionXLogicalDateTime->setVisible(checked);
353 ui.dtePositionXLogical->setVisible(checked);
354
355 ui.lPositionXLogical->setVisible(false);
356 ui.sbPositionXLogical->setVisible(false);
357 } else {
358 ui.lPositionXLogicalDateTime->setVisible(false);
359 ui.dtePositionXLogical->setVisible(false);
360
361 ui.lPositionXLogical->setVisible(checked);
362 ui.sbPositionXLogical->setVisible(checked);
363 }
364
365 ui.lPositionYLogical->setVisible(checked);
366 ui.sbPositionYLogical->setVisible(checked);
367
368 CONDITIONAL_LOCK_RETURN;
369
370 ui.chbBindLogicalPos->setChecked(checked);
371
372 for (auto* label : m_imageList)
373 label->setCoordinateBindingEnabled(checked);
374}
375
376// positioning using logical plot coordinates
377void ImageDock::positionXLogicalChanged(double value) {

Callers

nothing calls this directly

Calls 4

xRangeFormatDefaultMethod · 0.80
setVisibleMethod · 0.45
parentMethod · 0.45

Tested by

no test coverage detected