| 561 | } |
| 562 | |
| 563 | void 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 | |
| 595 | void InfoElement::curveDataChanged() { |
| 596 | Q_D(InfoElement); |
nothing calls this directly
no test coverage detected