MeasureLine ===========================
| 466 | // =========================== |
| 467 | // |
| 468 | MeasureLine::MeasureLine(QGraphicsView * primaryView, QGraphicsItem * parent /* = nullptr */) : |
| 469 | QGraphicsLineItem(parent), |
| 470 | _measureBox(new QComboBox), |
| 471 | _measureBoxProxy(new QGraphicsProxyWidget(this)), |
| 472 | _grip1(new MeasureLineGrip(this, 1)), |
| 473 | _grip2(new MeasureLineGrip(this, 2)), |
| 474 | _primaryView(primaryView) |
| 475 | { |
| 476 | _measureBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); |
| 477 | _measureBoxProxy->setWidget(_measureBox); |
| 478 | _measureBoxProxy->setFlag(QGraphicsItem::ItemIgnoresTransformations); |
| 479 | _measureBoxProxy->setFlag(QGraphicsItem::ItemSendsGeometryChanges); |
| 480 | |
| 481 | setAcceptHoverEvents(true); |
| 482 | setAcceptedMouseButtons(Qt::LeftButton); |
| 483 | } |
| 484 | |
| 485 | void MeasureLine::setLine(QLineF line) |
| 486 | { |
nothing calls this directly
no outgoing calls
no test coverage detected