def openContainer(self): self.removeItems() for category, id in Globals.get_grooves(): if category == self.id: item = SelectableItem(id, self) item.setPaletteBackgroundColor(groove_color) QObject.connect(item, PYSIGNAL('selected'), self.slotSelected) QObject.connect(item, PYSIGNAL('resized'), self.slotResize) self.items.append(item) ContainerItem.openContainer(self)
def updateGrooveCategories(self): """ Re-add the category items. """ # add the grooves for category, id in Globals.get_grooves(): # add new categories if not category in self.containerItems: self.containerItems[category] = GrooveContainerItem(category, self.backplate) QObject.connect(self.containerItems[category], PYSIGNAL('selected'), self.slotSelected) QObject.connect(self.containerItems[category], PYSIGNAL('resized'), self.slotResize) self.containerItems[category].show() self.rearrange()