python pyqt5 QTableWidget 设置表头

python pyqt5 QTableWidget 设置表头,第1张

'''

简介

PyQT5中表格头为自适应模式例子

'''

import sys

from PyQt5.QtWidgets import (QWidget, QTableWidget, QHBoxLayout, QApplication, QTableWidgetItem, QHeaderView)

class Table(QWidget):

def init (self):

super(). init ()

self.initUI()

if name == ' main ':

app = QApplication(sys.argv)

example = Table()

example.show()

sys.exit(app.exec_())

'''

【简介】

PyQT5中单元格内的文本颜色

'''

import sys

from PyQt5.QtWidgets import (QWidget, QTableWidget, QHBoxLayout, QApplication, QTableWidgetItem)

from PyQt5.QtGui import QBrush, QColor, QFont

class Table(QWidget):

def init (self):

super(). init ()

self.initUI()

if name == ' main ':

app = QApplication(sys.argv)

example = Table()

example.show()

sys.exit(app.exec_())


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/tougao/11345340.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-15
下一篇2023-05-15

发表评论

登录后才能评论

评论列表(0条)

    保存