# eric4.Graphics.UMLItem

Module implementing the UMLWidget base class.

### Global Attributes

None

### Classes

UMLItem | Class implementing the UMLItem base class.

### Functions

None

## UMLItem

Class implementing the UMLItem base class.

### Derived from

QGraphicsRectItem

### Class Attributes

None

### Methods

UMLItem | Constructor
addAssociation | Method to add an association to this widget.
adjustAssociations | Method to adjust the associations to widget movements.
itemChange | Protected method called when an items state changes.
moveBy | Overriden method to move the widget relative.
paint | Public method to paint the item in local coordinates.
removeAssociation | Method to remove an association to this widget.
removeAssociations | Method to remove all associations of this widget.
setPos | Overriden method to set the items position.
setSize | Public method to set the rectangles size.

#### UMLItem (Constructor)

UMLItem(x = 0, y = 0, rounded = False, parent = None)

Constructor

x
  x-coordinate (integer)
y
  y-coordinate (integer)
rounded
  flag indicating a rounded corner (boolean)
parent=
  reference to the parent object (QGraphicsItem)

#### UMLItem.addAssociation

addAssociation(assoc)

Method to add an association to this widget.

assoc
  association to be added (AssociationWidget)

#### UMLItem.adjustAssociations

adjustAssociations()

Method to adjust the associations to widget movements.

#### UMLItem.itemChange

itemChange(change, value)

Protected method called when an items state changes.

change
  the item's change (QGraphicsItem.GraphicsItemChange)
value
  the value of the change (QVariant)

Returns:
  adjusted values (QVariant)

#### UMLItem.moveBy

moveBy(dx, dy)

Overriden method to move the widget relative.

dx
  relative movement in x-direction (float)
dy
  relative movement in y-direction (float)

#### UMLItem.paint

paint(painter, option, widget = None)

Public method to paint the item in local coordinates.

painter
  reference to the painter object (QPainter)
option
  style options (QStyleOptionGraphicsItem)
widget
  optional reference to the widget painted on (QWidget)

#### UMLItem.removeAssociation

removeAssociation(assoc)

Method to remove an association to this widget.

assoc
  association to be removed (AssociationWidget)

#### UMLItem.removeAssociations

removeAssociations()

Method to remove all associations of this widget.

#### UMLItem.setPos

setPos(x, y)

Overriden method to set the items position.

x
  absolute x-position (float)
y
  absolute y-position (float)

#### UMLItem.setSize

setSize(width, height)

Public method to set the rectangles size.

width
  width of the rectangle (float)
height
  height of the rectangle (float)

Up