app.py 文件源码

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

项目:shortcircuit 作者: farshield 项目源码 文件源码
def add_data_to_table(self, route):
        self.tableWidget_path.setRowCount(len(route))
        for i, row in enumerate(route):
            for j, col in enumerate(row):
                item = QtGui.QTableWidgetItem("{}".format(col))
                self.tableWidget_path.setItem(i, j, item)

                if j in [1, 2]:
                    self.tableWidget_path.item(i, j).setTextAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)

                if row[1] == "HS":
                    color = QtGui.QColor(223, 240, 216)
                elif row[1] == "LS":
                    color = QtGui.QColor(252, 248, 227)
                elif row[1] == "NS":
                    color = QtGui.QColor(242, 222, 222)
                else:
                    color = QtGui.QColor(210, 226, 242)

                if j == 3 and "wormhole" in col:
                    self.tableWidget_path.item(i, j).setIcon(self.icon_wormhole)
                self.tableWidget_path.item(i, j).setBackground(color)
                self.tableWidget_path.item(i, j).setForeground(QtGui.QColor(0, 0, 0))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号