mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-04 03:24:13 +08:00
.
This commit is contained in:
parent
2a245d7832
commit
07cf4b7d9b
@ -970,21 +970,32 @@ class showdiction(QWidget):
|
|||||||
self.model.clear()
|
self.model.clear()
|
||||||
root = self.model.invisibleRootItem()
|
root = self.model.invisibleRootItem()
|
||||||
rows = []
|
rows = []
|
||||||
|
cishus = []
|
||||||
for k in globalconfig["cishuvisrank"]:
|
for k in globalconfig["cishuvisrank"]:
|
||||||
cishu = gobject.baseobject.cishus[k]
|
cishu = gobject.baseobject.cishus[k]
|
||||||
|
|
||||||
if not hasattr(cishu, "tree"):
|
if not hasattr(cishu, "tree"):
|
||||||
continue
|
continue
|
||||||
|
cishus.append(cishu)
|
||||||
|
if len(cishus) == 1:
|
||||||
try:
|
try:
|
||||||
tree = cishu.tree()
|
for node in cishus[0].tree().childrens():
|
||||||
|
item = QStandardItem(node.text())
|
||||||
|
item.setData(node, DictNodeRole)
|
||||||
|
rows.append(item)
|
||||||
except:
|
except:
|
||||||
continue
|
print_exc()
|
||||||
if not tree:
|
else:
|
||||||
continue
|
for cishu in cishus:
|
||||||
|
try:
|
||||||
|
tree = cishu.tree()
|
||||||
|
except:
|
||||||
|
continue
|
||||||
|
if not tree:
|
||||||
|
continue
|
||||||
|
|
||||||
item = QStandardItem(globalconfig["cishu"][k]["name"])
|
item = QStandardItem(globalconfig["cishu"][k]["name"])
|
||||||
item.setData(tree, DictNodeRole)
|
item.setData(tree, DictNodeRole)
|
||||||
rows.append(item)
|
rows.append(item)
|
||||||
root.appendRows(rows)
|
root.appendRows(rows)
|
||||||
root.setData(len(rows) > 0, DeterminedhasChildren)
|
root.setData(len(rows) > 0, DeterminedhasChildren)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user