Пример #1
0
    def updateTree(self):
        year = self.cmbYear.currentText()
        sMonth = self.cmbMonth.currentText()
        month = key_from_value(self.months, sMonth)

        data = LibStats.getStake(year, month)
        self.treeMonth.clear()

        items = []
        for i in data:
            item = QTreeWidgetItem(i)
            item = paint_row(item, i[4])
            items.append(item)
        self.treeMonth.addTopLevelItems(items)
Пример #2
0
    def initData(self):
        self.years, self.months = LibStats.getYears()
        self.cmbYear.addItems(self.years.keys())

        firstKey = next(iter(self.years))
        self.cmbMonth.addItems(self.getMonths(firstKey))

        data = LibStats.getStake()

        items = []
        for i in data:
            item = QTreeWidgetItem(i)
            item = paint_row(item, i[4])
            items.append(item)
        self.treeTotal.addTopLevelItems(items)

        self.updateMonths()