| 848 | } |
| 849 | |
| 850 | void MyGraphicsLineItem::drawArrow(){ |
| 851 | QPointF leftEnd = QPointF(eP.x() - cos(angle - M_PI / 6) * arrowLength, eP.y() - sin(angle - M_PI / 6) * arrowLength); |
| 852 | QPointF rightEnd = QPointF(eP.x() - cos(angle + M_PI / 6) * arrowLength, eP.y() - sin(angle + M_PI / 6) * arrowLength); |
| 853 | |
| 854 | QPainterPath arrowPath; |
| 855 | arrowPath.moveTo(leftEnd); |
| 856 | arrowPath.lineTo(eP); |
| 857 | arrowPath.lineTo(rightEnd); |
| 858 | |
| 859 | QGraphicsPathItem* arrowItem = new QGraphicsPathItem(arrowPath); |
| 860 | arrowItem->setPen(curPen); |
| 861 | this->scene()->addItem(arrowItem); |
| 862 | arrow = arrowItem; |
| 863 | } |
| 864 | |
| 865 | void MyGraphicsLineItem::delArrow(){ |
| 866 | if(arrow != nullptr){ |
nothing calls this directly
no outgoing calls
no test coverage detected