def createEditor(self, parent, styleOption, index): if index.column() == 0: editor = QLineEdit(parent) editor.setReadOnly(True) return editor editor = QSpinBox(parent) return editor