Graphics/UMLItem.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1112
8a7d1b9d18db
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
10 from PyQt4.QtCore import * 10 from PyQt4.QtCore import *
11 from PyQt4.QtGui import * 11 from PyQt4.QtGui import *
12 12
13 import Preferences 13 import Preferences
14 14
15
15 class UMLItem(QGraphicsRectItem): 16 class UMLItem(QGraphicsRectItem):
16 """ 17 """
17 Class implementing the UMLItem base class. 18 Class implementing the UMLItem base class.
18 """ 19 """
19 def __init__(self, x = 0, y = 0, rounded = False, parent = None): 20 def __init__(self, x=0, y=0, rounded=False, parent=None):
20 """ 21 """
21 Constructor 22 Constructor
22 23
23 @param x x-coordinate (integer) 24 @param x x-coordinate (integer)
24 @param y y-coordinate (integer) 25 @param y y-coordinate (integer)
123 """ 124 """
124 if change == QGraphicsItem.ItemPositionChange: 125 if change == QGraphicsItem.ItemPositionChange:
125 self.shouldAdjustAssociations = True 126 self.shouldAdjustAssociations = True
126 return QGraphicsItem.itemChange(self, change, value) 127 return QGraphicsItem.itemChange(self, change, value)
127 128
128 def paint(self, painter, option, widget = None): 129 def paint(self, painter, option, widget=None):
129 """ 130 """
130 Public method to paint the item in local coordinates. 131 Public method to paint the item in local coordinates.
131 132
132 @param painter reference to the painter object (QPainter) 133 @param painter reference to the painter object (QPainter)
133 @param option style options (QStyleOptionGraphicsItem) 134 @param option style options (QStyleOptionGraphicsItem)

eric ide

mercurial