diff --git a/src/view/network/GraphWidget.py b/src/view/network/GraphWidget.py index 8878bed479b8c386ece50d81784c0e414392d707..ff3d800963416d079938823c4c87dd944e8d9567 100644 --- a/src/view/network/GraphWidget.py +++ b/src/view/network/GraphWidget.py @@ -141,7 +141,7 @@ class EdgeItem(QGraphicsItem): elif not self.graph.graph.is_enable_edge(self.edge): color = Qt.darkGray - painter.setPen(QPen(color, 3, Qt.SolidLine, Qt.RoundCap, + painter.setPen(QPen(color, 2, Qt.SolidLine, Qt.RoundCap, Qt.RoundJoin)) # Draw the line painter.drawLine(line) @@ -152,6 +152,10 @@ class EdgeItem(QGraphicsItem): ) # Draw the arrows + brush = QBrush() + brush.setColor(color) + brush.setStyle(Qt.SolidPattern) + angle = math.acos(line.dx() / line.length()) if line.dy() >= 0: angle = (math.pi * 2.0) - angle @@ -165,8 +169,12 @@ class EdgeItem(QGraphicsItem): math.sin(angle - math.pi + math.pi / 3) * size, math.cos(angle - math.pi + math.pi / 3) * size ) + poly = QPolygonF([line_center, arrow_p1, arrow_p2]) + path = QPainterPath() + path.addPolygon(poly) - painter.drawPolygon(QPolygonF([line_center, arrow_p1, arrow_p2])) + painter.drawPolygon(poly) + painter.fillPath(path, brush) class NodeText(QGraphicsTextItem): def __init__(self, node_item):