logic: Show inheritance edges between parents of active symbol and other visible symbols (issue #167)

* add inheritance edges between parents of active symbol and other visible symbols
* add dashed inheritance edges when symbols are no direct decendants
* inheritance edges are also respected in layouting, putting base/derived classes in the correct top/bottom spot now

bug id = 167
This commit is contained in:
Eberhard Graether
2017-07-16 18:40:59 +02:00
parent 9a36d48d1e
commit 9d0b86ad98
19 changed files with 261 additions and 17 deletions
+19 -2
View File
@@ -32,7 +32,8 @@ QPainterPath QtLineItemAngled::shape() const
void QtLineItemAngled::paint(QPainter* painter, const QStyleOptionGraphicsItem* options, QWidget* widget)
{
painter->setPen(pen());
QPen p = pen();
painter->setPen(p);
QPainterPath path;
@@ -169,7 +170,17 @@ void QtLineItemAngled::paint(QPainter* painter, const QStyleOptionGraphicsItem*
partRect = getArrowBoundingRect(poly);
if (drawRect.intersects(partRect) && m_showArrow)
{
drawArrow(poly, &path);
if (m_style.dashed)
{
QPainterPath arrowPath;
drawArrow(poly, &path, &arrowPath);
painter->drawPath(arrowPath);
}
else
{
drawArrow(poly, &path);
}
}
else
{
@@ -177,5 +188,11 @@ void QtLineItemAngled::paint(QPainter* painter, const QStyleOptionGraphicsItem*
}
}
if (m_style.dashed)
{
p.setStyle(Qt::DashLine);
painter->setPen(p);
}
painter->drawPath(path);
}