add treeWidget Demo

This commit is contained in:
weike32 2019-04-26 22:34:00 +08:00
parent b95c424c3e
commit b5efbdf8dd

View file

@ -42,10 +42,10 @@ class MyTable(QTableWidget):
self.setVerticalHeaderLabels(["第一列", "第二列"]) self.setVerticalHeaderLabels(["第一列", "第二列"])
#设置表头 #设置表头
lbp = QLabel() lbp = QLabel()
lbp.setPixmap(QPixmap("Male.png")) lbp.setPixmap(QPixmap("youPicture.png"))
self.setCellWidget(1,1,lbp) self.setCellWidget(1,1,lbp)
#在表中添加一张图片 #在表中添加一张图片
twi = QTableWidgetItem(" 新海诚") twi = QTableWidgetItem("Graph")
twi.setFont(QFont("Times", 10, )) twi.setFont(QFont("Times", 10, ))
self.setItem(1,0,twi) self.setItem(1,0,twi)