
'''
【简介】
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_())
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)