Beispiel #1
0
 def createEditor(self, parent, option, index):
     m = index.model()
     col = m.column_map[index.column()]
     if check_key_modifier(Qt.ControlModifier):
         text = ''
     else:
         text = m.db.data[index.row()][m.custom_columns[col]['rec_index']]
     d = PlainTextDialog(parent, text, column_name=m.custom_columns[col]['name'])
     if d.exec_() == d.Accepted:
         m.setData(index, d.text, Qt.EditRole)
     return None
Beispiel #2
0
 def createEditor(self, parent, option, index):
     m = index.model()
     col = m.column_map[index.column()]
     if check_key_modifier(Qt.KeyboardModifier.ControlModifier):
         text = ''
     else:
         text = m.db.data[index.row()][m.custom_columns[col]['rec_index']]
     d = PlainTextDialog(parent, text, column_name=m.custom_columns[col]['name'])
     if d.exec_() == QDialog.DialogCode.Accepted:
         m.setData(index, d.text, Qt.ItemDataRole.EditRole)
     return None