how to make a cell in a QTableWidget read only?

后端 未结 3 1737
闹比i
闹比i 2021-02-13 10:04

i have the following code defining the gui of my app

class Ui (object):
    def setupUi():
        self.tableName = QtGui.QTableWidget(self.layoutWidget_20)
             


        
3条回答
  •  广开言路
    2021-02-13 10:34

    Like Sven Krüger's answer, you can also use this methods for PyQt5:

    self.tableWidget.setEditTriggers(QtWidgets.QTableWidget.NoEditTriggers)
    

提交回复
热议问题