lineyka_manager.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:lineyka 作者: volodya-renderberg 项目源码 文件源码
def tm_add_readers_ui_load_artist_list(self, workrom_name):
        table = self.selectReadersDialog.select_from_list_data_list_table
        workroom_dict = self.selectReadersDialog.workroom_dict

        self.clear_table(table)
        result = self.db_workroom.read_artist_of_workroom(workroom_dict[workrom_name]['id'])
        if not result[0]:
            self.message(result[1], 2)

        artirs_dict = result[1]

        # load table
        headers = ['nik_name', 'level']
        num_column = len(headers)
        num_row = 0
        if artirs_dict:
            num_row = len(artirs_dict)

        table.setColumnCount(num_column)
        table.setRowCount(num_row)
        table.setHorizontalHeaderLabels(headers)

        if artirs_dict:
            for i,reader_name in enumerate(artirs_dict):
                for j,key in enumerate(headers):
                    newItem = QtGui.QTableWidgetItem()
                    newItem.setText(artirs_dict[reader_name][key])
                    newItem.reader_name = reader_name

                    if key == 'nik_name':
                        color = self.artist_color
                        brush = QtGui.QBrush(color)
                        newItem.setBackground(brush)
                    if self.current_readers_list:
                        if reader_name in self.current_readers_list.keys():
                            color = self.grey_color
                            brush = QtGui.QBrush(color)
                            newItem.setBackground(brush)

                    table.setItem(i, j, newItem)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号