This commit is contained in:
test123456654321 2024-10-26 00:08:22 +08:00
parent 7ef2f9f904
commit 3f27875eed

View File

@ -923,7 +923,7 @@ class showdiction(LMainWindow):
self.tree.enterpressed.connect(self.model.onDoubleClicked) self.tree.enterpressed.connect(self.model.onDoubleClicked)
self.tree.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) self.tree.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
self.tree.customContextMenuRequested.connect(self.showmenu) self.tree.customContextMenuRequested.connect(self.showmenu)
good = False rows = []
for k in globalconfig["cishuvisrank"]: for k in globalconfig["cishuvisrank"]:
cishu = gobject.baseobject.cishus[k] cishu = gobject.baseobject.cishus[k]
@ -938,9 +938,9 @@ class showdiction(LMainWindow):
item = QStandardItem(globalconfig["cishu"][k]["name"]) item = QStandardItem(globalconfig["cishu"][k]["name"])
item.setData(tree, DictNodeRole) item.setData(tree, DictNodeRole)
root.appendRow([item]) rows.append(item)
good = True root.appendRows(rows)
root.setData(good, DeterminedhasChildren) root.setData(len(rows) > 0, DeterminedhasChildren)
class searchwordW(closeashidewindow): class searchwordW(closeashidewindow):