需要先设置行数
self.tableWidget.setRowCount(len(data))
本文来自博客园,作者:Re-Ch,基于 CC BY 4.0 协议发布
原文链接:https://www.cnblogs.com/rech/p/18304895