def setEditorData(self, editor, index): timestamp = index.model().data(index, Qt.EditRole) if timestamp == '': QSqlRelationalDelegate.setEditorData(self, editor, index) else: editor.setDateTime(datetime.fromtimestamp(timestamp))
def setEditorData(self, editor, index): amount = index.model().data(index, Qt.EditRole) if amount: editor.setText(self.formatFloatLong(float(amount))) else: QSqlRelationalDelegate.setEditorData(self, editor, index)
def setEditorData(self, editor, index): delegate = self.getDelegate(index) if delegate: delegate.setEditorData(editor, index) else: QSqlRelationalDelegate.setEditorData(self, editor, index)