--- a/E5Graphics/E5ArrowItem.py Tue Oct 15 22:03:54 2013 +0200 +++ b/E5Graphics/E5ArrowItem.py Fri Oct 18 23:00:41 2013 +0200 @@ -12,12 +12,14 @@ import math from PyQt4.QtCore import QPointF, QRectF, QSizeF, QLineF, Qt -from PyQt4.QtGui import QAbstractGraphicsShapeItem, QGraphicsItem, QStyle, QPen, QPolygonF +from PyQt4.QtGui import QAbstractGraphicsShapeItem, QGraphicsItem, QStyle, \ + QPen, QPolygonF NormalArrow = 1 WideArrow = 2 -ArrowheadAngleFactor = 0.26179938779914941 # 0.5 * math.atan(math.sqrt(3.0) / 3.0) +ArrowheadAngleFactor = 0.26179938779914941 +# 0.5 * math.atan(math.sqrt(3.0) / 3.0) class E5ArrowItem(QAbstractGraphicsShapeItem): @@ -103,14 +105,16 @@ @param option style options (QStyleOptionGraphicsItem) @param widget optional reference to the widget painted on (QWidget) """ - if (option.state & QStyle.State_Selected) == QStyle.State(QStyle.State_Selected): + if (option.state & QStyle.State_Selected) == \ + QStyle.State(QStyle.State_Selected): width = 2 else: width = 1 # draw the line first line = QLineF(self._origin, self._end) - painter.setPen(QPen(Qt.black, width, Qt.SolidLine, Qt.FlatCap, Qt.MiterJoin)) + painter.setPen( + QPen(Qt.black, width, Qt.SolidLine, Qt.FlatCap, Qt.MiterJoin)) painter.drawLine(line) # draw the arrow head