我有一张桌子。 当你想保存时,我得到了内存地址 PyQt4.QtGui.QTableWidgetItem对象位于0x0000000003E92CA8 这样做
def save_file(self):
filename = (QFileDialog.getSaveFileName(self, 'Save', '', ".xls(*.xls)"))
wbk = xlwt.Workbook()
sheet = wbk.add_sheet("diagram", cell_overwrite_ok=True)
self.s_f(sheet)
wbk.save(filename)
def s_f(self, sheet):
for currentColumn in range(self.table.columnCount()):
for currentRow in range(self.table.rowCount()):
my_icon = self.table.item(currentRow, currentColumn)
sheet.write(currentRow, currentColumn, str(my_icon or ''))
如何使用图片保存表格?