Graphics/PackageItem.py

changeset 3591
2f2a4a76dd22
parent 3178
f25fc1364c88
child 3656
441956d8fce5
equal deleted inserted replaced
3590:5280e37405b8 3591:2f2a4a76dd22
31 31
32 self.moduleslist = moduleslist 32 self.moduleslist = moduleslist
33 33
34 def addModule(self, modulename): 34 def addModule(self, modulename):
35 """ 35 """
36 Method to add a module to the package model. 36 Public method to add a module to the package model.
37 37
38 @param modulename module name to be added (string) 38 @param modulename module name to be added (string)
39 """ 39 """
40 self.moduleslist.append(modulename) 40 self.moduleslist.append(modulename)
41 41
42 def getModules(self): 42 def getModules(self):
43 """ 43 """
44 Method to retrieve the modules of the package. 44 Public method to retrieve the modules of the package.
45 45
46 @return list of module names (list of strings) 46 @return list of module names (list of strings)
47 """ 47 """
48 return self.moduleslist[:] 48 return self.moduleslist[:]
49 49
109 else: 109 else:
110 self.modules = None 110 self.modules = None
111 111
112 def __calculateSize(self): 112 def __calculateSize(self):
113 """ 113 """
114 Method to calculate the size of the package widget. 114 Private method to calculate the size of the package widget.
115 """ 115 """
116 if self.model is None: 116 if self.model is None:
117 return 117 return
118 118
119 width = self.header.boundingRect().width() 119 width = self.header.boundingRect().width()
133 if self.modules: 133 if self.modules:
134 self.modules.setPos(x, y) 134 self.modules.setPos(x, y)
135 135
136 def setModel(self, model): 136 def setModel(self, model):
137 """ 137 """
138 Method to set the package model. 138 Public method to set the package model.
139 139
140 @param model package model containing the package data (PackageModel) 140 @param model package model containing the package data (PackageModel)
141 """ 141 """
142 self.scene().removeItem(self.header) 142 self.scene().removeItem(self.header)
143 self.header = None 143 self.header = None

eric ide

mercurial