| 446 | } |
| 447 | |
| 448 | void DatapickerImage::setPlotPointsType(const PointsType pointsType) { |
| 449 | Q_D(DatapickerImage); |
| 450 | if (d->plotPointsType == pointsType) |
| 451 | return; |
| 452 | |
| 453 | d->plotPointsType = pointsType; |
| 454 | |
| 455 | if (pointsType == DatapickerImage::PointsType::AxisPoints) { |
| 456 | // clear image |
| 457 | clearReferencePoints(); |
| 458 | m_segments->setSegmentsVisible(false); |
| 459 | } else if (pointsType == DatapickerImage::PointsType::CurvePoints) { |
| 460 | m_segments->setSegmentsVisible(false); |
| 461 | |
| 462 | // make the reference points non-interactive |
| 463 | const auto& points = children<DatapickerPoint>(ChildIndexFlag::IncludeHidden); |
| 464 | for (auto* point : points) { |
| 465 | auto* item = point->graphicsItem(); |
| 466 | item->setFlag(QGraphicsItem::ItemIsSelectable, false); |
| 467 | item->setFlag(QGraphicsItem::ItemIsFocusable, false); |
| 468 | item->setAcceptHoverEvents(false); |
| 469 | item->setAcceptedMouseButtons(Qt::NoButton); |
| 470 | } |
| 471 | } else if (pointsType == DatapickerImage::PointsType::SegmentPoints) { |
| 472 | d->makeSegments(); |
| 473 | m_segments->setSegmentsVisible(true); |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | void DatapickerImage::setPointSeparation(const int value) { |
| 478 | Q_D(DatapickerImage); |
no test coverage detected