| 834 | } |
| 835 | |
| 836 | void MyGraphicsLineItem::drawText(){ |
| 837 | if(textItem){ |
| 838 | this->scene()->removeItem(textItem); |
| 839 | textItem = nullptr; |
| 840 | } |
| 841 | QGraphicsSimpleTextItem *t = new QGraphicsSimpleTextItem(text); |
| 842 | t->setFont(textFont); |
| 843 | t->setPos(center - QPointF(t->boundingRect().width(), t->boundingRect().height()) / 2); |
| 844 | QColor c = curPen.color(); |
| 845 | t->setBrush(c.darker(150)); |
| 846 | this->scene()->addItem(t); |
| 847 | textItem = t; |
| 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); |
nothing calls this directly
no outgoing calls
no test coverage detected