作者 – 杨小名
from PyQt5.QtWidgets import (QTableWidget,QCheckBox,QHeaderView,QAbstractItemView,QTableWidgetItem,
QPushButton)
from PyQt5.QtCore import Qt,QSize,QPoint,QRect
from PyQt5.QtGui import QIcon,QMouseEvent,QFont,QColor,QBrush
from views.sys_set import readJson
class QTable(QTableWidget):
all_checkbox = []
def init(self,x=1,y=5):
super(QTable,self).init(x,y) # 默认1行 5列 第一行为表头
self.setTableStyle()
def setTableStyle(self):
self.horizontalHeader().resizeSection(0, 100)
self.horizontalHeader().resizeSection(1, 100)
self.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
self.horizontalHeader().setSectionResizeMode(0, QHeaderView.Interactive)
self.horizontalHeader().setSectionResizeMode(1, QHeaderView.Interactive)
self.horizontalHeader().setSectionResizeMode(2, QHeaderView.Interactive)
self.horizontalHead