在我的程序中,我需要删除qtable小部件中特定行的边框,我尝试了许多方法,但是这些方法不起作用。我不知道要编写委托吗,请问有人可以帮助我如何在pyqt4的表格小部件中删除边框
self.table1 = QtGui.QTableWidget()
self.table1.setFocusPolicy(QtCore.Qt.NoFocus);
self.table1.setStyleSheet("QTableWidget{gridline-color: white}")
self.Inventory_scrollarea = QtGui.QScrollArea(widgetResizable=True)
self.Inventory_scrollarea.setWidget(self.inventory_widget)
self.Inventory_scrollarea.showFullScreen()
self.table1.horizontalHeader().hide()
self.table_item1 = QtGui.QTableWidgetItem()
self.table1.setRowCount(21)
self.table1.verticalHeader().hide()
self.table1.setColumnCount(7)
stylesheet1 = "::section{Background-color:black;color: white;font-size: 25px;}"
header1 = self.table1.horizontalHeader()
vh1 = self.table1.verticalHeader()
vh1.setDefaultSectionSize(50)
header1.setResizeMode(0, QtGui.QHeaderView.ResizeToContents)
header1.setResizeMode(1, QtGui.QHeaderView.ResizeToContents)
header1.setResizeMode(2, QtGui.QHeaderView.Stretch)
header1.setResizeMode(3, QtGui.QHeaderView.ResizeToContents)
header1.setResizeMode(4, QtGui.QHeaderView.Stretch)
header1.setResizeMode(5, QtGui.QHeaderView.ResizeToContents)
header1.setResizeMode(6, QtGui.QHeaderView.ResizeToContents)
以下是我的图片:
我想删除第2,3行的边框 enter image description here