适用于 PyQT5
使得表格为 read only
但同时保持可以左右上下滑动
item = QtWidgets.QTableWidgetItem()
item.setFlags(QtCore.Qt.ItemIsEnabled)
resize 表格各空大小
image.pngset 表格各空背景色
You must first create an item in that place in the table, before you can set its background color.
self.tableWidget.setItem(3, 5, QtGui.QTableWidgetItem())
self.tableWidget.item(3, 5).setBackground(QtGui.QColor(100,100,150))
网友评论