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

Method curveVisibilityChanged

src/backend/worksheet/InfoElement.cpp:563–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561}
562
563void InfoElement::curveVisibilityChanged() {
564 XYCurve* curve = static_cast<XYCurve*>(QObject::sender());
565 bool visible = curve->isVisible();
566
567 bool oneMarkerpointVisible = false;
568 for (auto& custompoint : markerpoints) {
569 if (custompoint.curve == curve)
570 custompoint.customPoint->setVisible(visible);
571
572 if (custompoint.customPoint->isVisible())
573 oneMarkerpointVisible = true;
574 }
575
576 // if curve was set to hidden, set InfoElement to first visible curve
577 if (!visible) {
578 for (auto& custompoint : markerpoints) {
579 if (custompoint.curve->isVisible()) {
580 setConnectionLineCurveName(custompoint.curve->name());
581 break;
582 }
583 }
584 }
585
586 // if no markerpoints are visible, hide the title label
587 m_title->setUndoAware(false);
588 if ((!visible && markerpoints.count() == 0) || !oneMarkerpointVisible)
589 m_title->setVisible(false);
590 else
591 m_title->setVisible(true);
592 m_title->setUndoAware(true);
593}
594
595void InfoElement::curveDataChanged() {
596 Q_D(InfoElement);

Callers

nothing calls this directly

Calls 5

setUndoAwareMethod · 0.80
isVisibleMethod · 0.45
setVisibleMethod · 0.45
nameMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected