def __init__(self, treeWidget, items, MF): super().__init__() treeWidget.clear() root = QTreeWidgetItem(treeWidget) root.setText(0, "功能列表") root.FullPath = "Function" self.root = root self.items = items
def __init__(self, treeWidget, items): super().__init__() treeWidget.clear() root = QTreeWidgetItem(treeWidget) root.setText(0, "Function") root.FullPath = "Function" self.root = root self.items = items self.icopath = getcwd() + "\\res\\ico\\{}"
def addItems(self, parent, items): for r in items: item = QTreeWidgetItem(parent) item.setText(0, r["fMenuText"]) item.setIcon(0, QIcon(self.icoPath.format(r["fIcon"]))) item.jpData = r item.FullPath = (parent.FullPath + '\\' + r["fMenuText"]) lst = [l for l in self.items if l["fParentId"] == r["fNMID"]] self.addItems(item, lst) item.setExpanded(1)
def __init__(self, treeWidget, items): super().__init__() treeWidget.clear() title1 = "权限分配 Permission Assignment【{}】" tree_title = [title1.format(items[0]['fUsername']), "Right"] treeWidget.setHeaderLabels(tree_title) treeWidget.dirty = False root = QTreeWidgetItem(treeWidget) root.setText(0, "Function") root.FullPath = "Function" root.key = 1 root.dirty = False treeWidget._rootItem = root self.root = root self.items = items
def __init__(self, treeWidget, items): super().__init__() treeWidget.clear() tree_title = ["项目列表", "选择"] treeWidget.setHeaderLabels(tree_title) treeWidget.dirty = False root = QTreeWidgetItem(treeWidget) root.setText(0, "高科集团") root.FullPath = "高科集团" root.key = "ORG000" root.dirty = False treeWidget._rootItem = root self.root = root self.items = items self.selected_project = selected_project
def addItems(self, parent, items): for r in items: item = QTreeWidgetItem(parent) item.setText(0, r["fMenuText"]) if r["fIcon"]: item.setIcon(0, QIcon(self.icopath.format(r["fIcon"]))) st = (Qt.Checked if r['fHasRight'] == 1 else Qt.Unchecked) if not r["fDefault"]: item.setCheckState(1, st) item.jpData = r item.dirty = False item.FullPath = (parent.FullPath + '\\' + r["fMenuText"]) self.addItems( item, [l for l in self.items if l["fParentId"] == r["fNMID"]]) item.setExpanded(1)
def addItems(self, parent, items): for r in items: item = QTreeWidgetItem(parent) item.setText(0, r["nm"]) item.key = r['pk'] if r['pk'][0:3] != 'ORG': if r["pk"] in self.selected_project: item.setCheckState(1, Qt.Checked) self.parentChecked(item.parent()) else: item.setCheckState(1, Qt.Unchecked) item.jpData = r item.dirty = False item.FullPath = (parent.FullPath + '\\' + r["nm"]) self.addItems(item, [l for l in self.items if l["par"] == r["pk"]])
def addItems(self, parent, items): for r in items: item = QTreeWidgetItem(parent) item.setText(0, r["fMenuText"]) item.setText(1, str(r["fDispIndex"])) item.setText(2, str(r["fIcon"])) item.setCheckState(3, r["fDefault"]) #item.setText(3, str(r["fDefault"])) item.setText(4, str(r["fNodeBackvolor"])) item.setText(5, str(r["fNodeForeColor"])) item.setText(6, str(r["fNodeFontBold"])) #print(self.icopath.format(r["fIcon"])) item.setIcon(0, QIcon(self.icopath.format(r["fIcon"]))) item.jpData = r item.FullPath = (parent.FullPath + '\\' + r["fMenuText"]) lst = [l for l in self.items if l["fParentId"] == r["fNMID"]] self.addItems(item, lst) item.setExpanded(1)