134 @param painter reference to the painter object (QPainter) |
134 @param painter reference to the painter object (QPainter) |
135 @param option style options (QStyleOptionGraphicsItem) |
135 @param option style options (QStyleOptionGraphicsItem) |
136 @param widget optional reference to the widget painted on (QWidget) |
136 @param widget optional reference to the widget painted on (QWidget) |
137 """ |
137 """ |
138 pen = self.pen() |
138 pen = self.pen() |
139 if (option.state & QStyle.State_Selected) == QStyle.State(QStyle.State_Selected): |
139 if (option.state & QStyle.State_Selected) == \ |
|
140 QStyle.State(QStyle.State_Selected): |
140 pen.setWidth(2) |
141 pen.setWidth(2) |
141 else: |
142 else: |
142 pen.setWidth(1) |
143 pen.setWidth(1) |
143 |
144 |
144 painter.setPen(pen) |
145 painter.setPen(pen) |
159 def buildItemDataString(self): |
160 def buildItemDataString(self): |
160 """ |
161 """ |
161 Public method to build a string to persist the specific item data. |
162 Public method to build a string to persist the specific item data. |
162 |
163 |
163 This string must start with ", " and should be built like |
164 This string must start with ", " and should be built like |
164 "attribute=value" with pairs separated by ", ". value must not contain ", " |
165 "attribute=value" with pairs separated by ", ". value must not |
165 or newlines. |
166 contain ", " or newlines. |
166 |
167 |
167 @return persistence data (string) |
168 @return persistence data (string) |
168 """ |
169 """ |
169 entries = [ |
170 entries = [ |
170 "name={0}".format(self.model.getName()), |
171 "name={0}".format(self.model.getName()), |