Graphics/ModuleItem.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 2992
dbdf27746da5
child 3145
a9de05d4a22f
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
136 @param painter reference to the painter object (QPainter) 136 @param painter reference to the painter object (QPainter)
137 @param option style options (QStyleOptionGraphicsItem) 137 @param option style options (QStyleOptionGraphicsItem)
138 @param widget optional reference to the widget painted on (QWidget) 138 @param widget optional reference to the widget painted on (QWidget)
139 """ 139 """
140 pen = self.pen() 140 pen = self.pen()
141 if (option.state & QStyle.State_Selected) == QStyle.State(QStyle.State_Selected): 141 if (option.state & QStyle.State_Selected) == \
142 QStyle.State(QStyle.State_Selected):
142 pen.setWidth(2) 143 pen.setWidth(2)
143 else: 144 else:
144 pen.setWidth(1) 145 pen.setWidth(1)
145 146
146 painter.setPen(pen) 147 painter.setPen(pen)
161 def buildItemDataString(self): 162 def buildItemDataString(self):
162 """ 163 """
163 Public method to build a string to persist the specific item data. 164 Public method to build a string to persist the specific item data.
164 165
165 This string must start with ", " and should be built like 166 This string must start with ", " and should be built like
166 "attribute=value" with pairs separated by ", ". value must not contain ", " 167 "attribute=value" with pairs separated by ", ". value must not
167 or newlines. 168 contain ", " or newlines.
168 169
169 @return persistence data (string) 170 @return persistence data (string)
170 """ 171 """
171 entries = [ 172 entries = [
172 "name={0}".format(self.model.getName()), 173 "name={0}".format(self.model.getName()),

eric ide

mercurial