def loadVorteile(self):
self.uiVor.treeWidget.blockSignals(True)
vortList = [[],[],[],[],[],[],[],[]]
for el in Wolke.DB.vorteile:
if Wolke.Char.voraussetzungenPrüfen(Wolke.DB.vorteile[el].voraussetzungen):
idx = Wolke.DB.vorteile[el].typ
vortList[idx].append(el)
for i in range(len(vortList)):
itm = self.uiVor.treeWidget.topLevelItem(i)
if type(itm) != QtWidgets.QTreeWidgetItem:
continue
if itm == 0:
continue
for j in range(itm.childCount()):
chi = itm.child(j)
if type(chi) != QtWidgets.QTreeWidgetItem:
continue
txt = chi.text(0)
if txt in Wolke.Char.vorteile or txt == Wolke.Char.minderpakt:
chi.setCheckState(0, QtCore.Qt.Checked)
else:
chi.setCheckState(0, QtCore.Qt.Unchecked)
if txt not in vortList[i] and txt != Wolke.Char.minderpakt:
chi.setHidden(True)
if txt in Wolke.Char.vorteile:
chi.setCheckState(0,QtCore.Qt.Unchecked)
Wolke.Char.vorteile.remove(txt)
else:
chi.setHidden(False)
if Wolke.DB.vorteile[el].variable!=0:
Wolke.Char.vorteileVariable[el] = self.itemWidgets[el].value()
self.updateInfo()
self.uiVor.treeWidget.blockSignals(False)
评论列表
文章目录