资讯动态

Qt5中tableView控件显示消息

发布时间:2026/10/1 17:16:48 来源:尧图企业网站定制
Qt5中tableView控件显示消息cell_nameself.comboBox.currentText()p_warn_cell p_warn_cell[p_warn_cell[小区名称_故障小区] cell_name]model QStandardItemModel()model.setHorizontalHeaderLabels(p_warn_cell.columns.tolist())forrowinrange(len(p_warn_cell)):forcolumninrange(p_warn_cell.columns.size):item QStandardItem(str(p_warn_cell.iat[row, column]))model.setItem(row, column, item)#model.setData(model.index(0, p_warn_cell.columns.size), brush, Qt.ForegroundRole) #设置第1行第1列的字体颜色为红色self.tableView_2.setModel(model)#显示QTableViewself.tableView_2.show()

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价 →
↑