File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -154,10 +154,24 @@ def visible(self, visible=False):
154154
155155 @property
156156 def xy_pos (self ):
157+ """
158+ return the item scene postion.
159+ ("node.pos" conflicted with "QGraphicsItem.pos()" so it was refactored to "xy_pos".)
160+
161+ Returns:
162+ list[float]: x, y scene position.
163+ """
157164 return [float (self .scenePos ().x ()), float (self .scenePos ().y ())]
158165
159166 @xy_pos .setter
160167 def xy_pos (self , pos = None ):
168+ """
169+ set the item scene postion.
170+ ("node.pos" conflicted with "QGraphicsItem.pos()" so it was refactored to "xy_pos".)
171+
172+ Args:
173+ pos (list[float]): x, y scene position.
174+ """
161175 pos = pos or [0.0 , 0.0 ]
162176 self .setPos (pos [0 ], pos [1 ])
163177
@@ -211,6 +225,7 @@ def from_dict(self, node_dict):
211225 node_attrs = list (self ._properties .keys ()) + ['width' , 'height' , 'pos' ]
212226 for name , value in node_dict .items ():
213227 if name in node_attrs :
228+ # "node.pos" conflicted with "QGraphicsItem.pos()" so it's refactored to "xy_pos".
214229 if name == 'pos' :
215230 name = 'xy_pos'
216231 setattr (self , name , value )
You can’t perform that action at this time.
0 commit comments