MCPcopy Create free account
hub / github.com/Linloir/GraphBuilder / drawArrow

Method drawArrow

graph_view.cpp:850–863  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

848}
849
850void 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
865void MyGraphicsLineItem::delArrow(){
866 if(arrow != nullptr){

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected