1 importtyping2 from PyQt5 importQtCore, QtGui3 from PyQt5.QtWidgets importQTableView, QAbstractItemView, QHeaderView, QAbstractSlider4 from PyQt5.QtCore importQt, QModelIndex5
6
7 classFreezeTableView(QTableView, QAbstractSlider):8
9 def __init__(self, model):10 super(FreezeTableView, self).__init__()11 self.model =model12 self.frozenTableView =QTableView(self)13 self.horizontalView =QTableView(self)14 self.up =True15
16 definit(self):17 self.setModel(self.model)18 self.frozenTableInit()19 self.horizontalViewInit()20
21 self.horizontalHeader().sectionResized.connect(self.updateSectionWidth)22 self.verticalHeader().sectionResized.connect(self.updateSectionHeight)23 self.verticalScrollBar().valueChanged.connect(self.vConnectFV)24 self.frozenTableView.verticalScrollBar().valueChanged.connect(self.fVConnectV)25 self.horizontalScrollBar().valueChanged.connect(self.hConnectH)26
27 defvCo