# eric3.Graphics.ModuleWidget

Module implementing a module widget.

### Classes

ModuleModel | Class implementing the module model.
ModuleWidget | Class implementing a module widget.

### Functions

None

## ModuleModel

Class implementing the module model.

### Derived from

None

### Methods

ModuleModel | Constructor
addClass | Method to add a class to the module model.
getClasses | Method to retrieve the classes of the module.
getName | Method to retrieve the module name.

### ModuleModel (Constructor)

ModuleModel(name, classlist=[])

Constructor

name
  the module name (string)
classlist
  list of class names (list of strings)

### ModuleModel.addClass

addClass(classname)

Method to add a class to the module model.

classname
  class name to be added (string)

### ModuleModel.getClasses

getClasses()

Method to retrieve the classes of the module.

Returns:
  list of class names (list of strings)

### ModuleModel.getName

getName()

Method to retrieve the module name.

Returns:
  module name (string)

Up

## ModuleWidget

Class implementing a module widget.

### Derived from

UMLWidget

### Methods

ModuleWidget | Constructor
calculateSize | Method to calculate the size of the module widget.
drawShape | Overriden method to draw the shape.
setModel | Method to set the module model.

### ModuleWidget (Constructor)

ModuleWidget(canvas, model=None, x=0, y=0, rounded=0)

Constructor

canvas
  canvas containing the class widget (QCanvas)
model
  module model containing the module data (ModuleModel)
x
  x-coordinate (integer)
y
  y-coordinate (integer)
rounded
  flag indicating a rounded corner (boolean)

### ModuleWidget.calculateSize

calculateSize()

Method to calculate the size of the module widget.

### ModuleWidget.drawShape

drawShape(painter)

Overriden method to draw the shape.

painter
  painter the shape is drawn to (QPainter)

### ModuleWidget.setModel

setModel(model)

Method to set the module model.

model
  module model containing the module data (ModuleModel)

Up