how to make a cell in a QTableWidget read only?

后端 未结 3 1736
闹比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:47

    The editing status of a QTableWidgetItem is never entered when there are no Edit Triggers:

    self.tableName.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)

提交回复
热议问题