114 |
114 |
115 @param painter reference to the painter object (QPainter) |
115 @param painter reference to the painter object (QPainter) |
116 @param option style options (QStyleOptionGraphicsItem) |
116 @param option style options (QStyleOptionGraphicsItem) |
117 @param widget optional reference to the widget painted on (QWidget) |
117 @param widget optional reference to the widget painted on (QWidget) |
118 """ |
118 """ |
119 if ( |
119 width = 2 if ( |
120 (option.state & QStyle.StateFlag.State_Selected) == |
120 (option.state & QStyle.StateFlag.State_Selected) == |
121 QStyle.State(QStyle.StateFlag.State_Selected) |
121 QStyle.State(QStyle.StateFlag.State_Selected) |
122 ): |
122 ) else 1 |
123 width = 2 |
|
124 else: |
|
125 width = 1 |
|
126 |
123 |
127 # draw the line first |
124 # draw the line first |
128 line = QLineF(self._origin, self._end) |
125 line = QLineF(self._origin, self._end) |
129 painter.setPen( |
126 painter.setPen( |
130 QPen(self._colors[0], width, Qt.PenStyle.SolidLine, |
127 QPen(self._colors[0], width, Qt.PenStyle.SolidLine, |