I'd suggest to use these signals to get notified about editing value:
void editorModifying(GridEditor* editor); - changing some value in the editor
void editorStoping(EditorEventArgs* args) - before the end edititng, the value is not in the model
void editorStoped(EditorEventArgs* args) - editor stoped, the value in the model.
void editorValidating(EditorValidationEventArgs* args) - the value validatation. It depends on GridEditorRepository::immediatePost() and GridEditorRepository::validateOnEnter() flags.
Looks like you need editorStoped() and commit the value to the other model's cells on it.
See my python debug code:
from DevMachines.QtitanGrid import (GridEditor, EditorEventArgs, EditorValidationEventArgs)
.....
self.connect(view, SIGNAL("editorModifying(GridEditor*)"), self, SLOT("viewEditorModifying(GridEditor*)"))
self.connect(view, SIGNAL("editorStoping(EditorEventArgs*)"), self, SLOT("viewEditorStoping(EditorEventArgs*)"))
self.connect(view, SIGNAL("editorStoped(EditorEventArgs*)"), self, SLOT("viewEditorStoped(EditorEventArgs*)"))
self.connect(view, SIGNAL("editorValidating(EditorValidationEventArgs*)"), self, SLOT("viewEditorValidating(EditorValidationEventArgs*)"))
....................
@QtCore.Slot(GridEditor)
def viewEditorModifying(self, editor):
view = self.grid.view()
print("editorModifying: " + str(editor))
print("editorModifying, value: " + str(editor.getContextValue()))
@QtCore.Slot(EditorEventArgs)
def viewEditorStoping(self, args):
view = self.grid.view()
print("editorStoping: " + str(args) + "args.modelRowIndex: " + str(args.row().modelRowIndex()))
print("editorStoping, value: " + str(view.activeEditor().getContextValue()))
@QtCore.Slot(EditorEventArgs)
def viewEditorStoped(self, args):
view = self.grid.view()
print("editorStoped: " + str(args))
print("editorStoped, value: " + str(view.activeEditor().getContextValue()))
@QtCore.Slot(EditorValidationEventArgs)
def viewEditorValidating(self, args):
print("editorValidating: " + str(args))
print("editorValidating, edit value: " + str(args.editValue()))
print("editorValidating, editing value: " + str(args.editingValue()))
print("editorValidating, index: " + str(args.modelIndex()))