本来想用ribbon的想想还是算了,然后随便找了个仿ribbon的库凑合用用。
目前对
图形颜色、
字体进行了优化。

整个程序可能就连接线移动算法稍微复杂一点吧。
然后分享一下画箭头一个通用算法吧,给定任意一条直线都能在线的endpos 或者startpos画出箭头
double arrowSize = 16.0;
double arrowAngle = 0.5;
QPointF startPos = this->line().p1();
QPointF endPos =this->line().p2();
double angle = atan2((endPos.y() - startPos.y()), (endPos.x() - startPos.x()));
m_arrowLine1->setLine(QLineF(endPos.x(),
endPos.y(),
endPos.x() - arrowSize*cos(angle + arrowAngle),
endPos.y() - arrowSize*sin(angle + arrowAngle)));
m_arrowLine2->setLine(QLineF(endPos.x(),
endPos.y(),
endPos.x() - arrowSize*cos(angle - arrowAngle),
endPos.y() - arrowSize*sin(angle - arrowAngle)));
最后还是给个体验版玩玩吧
链接:
https://pan.baidu.com/s/1D5b4tty1Pgyz7icF2Iac-w 提取码:0rrd