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

Method drawText

graph_view.cpp:836–848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

834}
835
836void 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
850void MyGraphicsLineItem::drawArrow(){
851 QPointF leftEnd = QPointF(eP.x() - cos(angle - M_PI / 6) * arrowLength, eP.y() - sin(angle - M_PI / 6) * arrowLength);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected