def addButton(self): self.i += 1 button = DragButton(str(self.i), self) button.setButtonList(self.button_list) button.setButtonHeight(BUTTON_HEIGHT) button.clicked.connect(self.clicked) self.connect(button, QtCore.SIGNAL("drag_event_ended()"), self.reorganize) button.setFixedWidth( WIDTH - SCROLLBAR_WIDTH ) button.setFixedHeight( BUTTON_HEIGHT ) button.move(0, len(self.button_list) * BUTTON_HEIGHT) self.button_list.append(button) button.show() self.setFixedHeight( len(self.button_list) * BUTTON_HEIGHT + 2*BUTTON_HEIGHT)
def addButton(self): self.i += 1 # button = DragButton(str(self.i), self) button = DragButton(str(self.i), self) button.setButtonList(self.button_list) button.setButtonHeight(BUTTON_HEIGHT) # button.clicked.connect(self.clicked) button.left_clicked.connect(self.leftClicked) button.right_clicked.connect(self.rightClicked) button.drag_event_ended.connect(self.reorganize) button.setFixedWidth(WIDTH - SCROLLBAR_WIDTH) button.setFixedHeight(BUTTON_HEIGHT) button.move(0, len(self.button_list) * BUTTON_HEIGHT) button.button_id = self.i self.button_list.append(button) button.show() self.setFixedHeight(len(self.button_list) * BUTTON_HEIGHT + 2 * BUTTON_HEIGHT)