def contextMenuEvent(self, event): from BLANK_panel.BLANK_panel import BLANK_panel ContextMenu = QMenu(self) CloseAction = ContextMenu.addAction("Close Panel") action = ContextMenu.exec_(self.mapToGlobal(event.pos())) if action == CloseAction: if len(self.id) == 4: uppernum = str(int(self.id) + 1) else: panelnum = self.id[2] uppanelnum = str(int(panelnum) + 1) uppernum = self.id[0] + self.id[1] + uppanelnum Data[self.id].setWidget(BLANK_panel(self.id, self.nodename)) Data[uppernum].setWidget(BLANK_panel(self.id, self.nodename)) if Data["Nodes"][self.nodename]["Panels"][ self.id]["Sockets"]["Line"] == 2: self.countdown_fun(self.nodename, "100GE", 2) self.modify_linelist(self.nodename, -1) if Data["Nodes"][self.nodename]["Panels"][ self.id]["Sockets"]["Line"] == 1: self.countdown_fun(self.nodename, "100GE", 1) Data["Nodes"][self.nodename]["Panels"].pop(str(self.id)) Data["Nodes"][self.nodename]["Panels"].pop(str(uppernum))
def contextMenuEvent(self, event): from BLANK_panel.BLANK_panel import BLANK_panel ContextMenu = QMenu(self) CloseAction = ContextMenu.addAction("Close Panel") action = ContextMenu.exec_(self.mapToGlobal(event.pos())) if action == CloseAction: Panel_Data[self.id].setWidget(BLANK_panel(self.id,self.nodename)) Data["Nodes"][self.nodename]["Panels"].pop(str(self.id))