当我运行此代码时,标题比我想要的高得多 - 如何在不改变宽度的情况下编辑高度? (我不想编辑宽度,因为它是可变的)
headers = ['A','BCDE','FG','HIJKLMN','OP','QRST','UVWX','Y','Z']
length = len(headers)
for i in range(length):
item = QtGui.QTableWidgetItem()
item.setText(headers[i])
item.setFlags(QtCore.Qt.ItemIsEnabled)
font = QtGui.QFont('Cambria Math', 10, QtGui.QFont.Light)
item.setFont(font)
self.tableWidget2.setHorizontalHeaderItem(i, item)