From 3f27875eed04718cf5fea52a7b4d321b0745b7b5 Mon Sep 17 00:00:00 2001 From: test123456654321 <16307130148@fudan.edu.cn> Date: Sat, 26 Oct 2024 00:08:22 +0800 Subject: [PATCH] rows --- src/LunaTranslator/gui/showword.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/LunaTranslator/gui/showword.py b/src/LunaTranslator/gui/showword.py index b1b54470..77028799 100644 --- a/src/LunaTranslator/gui/showword.py +++ b/src/LunaTranslator/gui/showword.py @@ -923,7 +923,7 @@ class showdiction(LMainWindow): self.tree.enterpressed.connect(self.model.onDoubleClicked) self.tree.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) self.tree.customContextMenuRequested.connect(self.showmenu) - good = False + rows = [] for k in globalconfig["cishuvisrank"]: cishu = gobject.baseobject.cishus[k] @@ -938,9 +938,9 @@ class showdiction(LMainWindow): item = QStandardItem(globalconfig["cishu"][k]["name"]) item.setData(tree, DictNodeRole) - root.appendRow([item]) - good = True - root.setData(good, DeterminedhasChildren) + rows.append(item) + root.appendRows(rows) + root.setData(len(rows) > 0, DeterminedhasChildren) class searchwordW(closeashidewindow):