i have the following code defining the gui of my app
class Ui (object): def setupUi(): self.tableName = QtGui.QTableWidget(self.layoutWidget_20)
Like Sven Krüger's answer, you can also use this methods for PyQt5:
self.tableWidget.setEditTriggers(QtWidgets.QTableWidget.NoEditTriggers)