[PyQt] commitData signal with custom delegates
Erik.Janssens at conceptive.be
Wed Oct 1 10:15:56 BST 2008
I have created a custom editor widget together with a custom delegates,
used in a form together with a QDataWidgetMapper.
According to the documentation (and the source code confirms this), when
the editor has finished editing, the delegate should emit the commitData
signal, if this is received by the QDataWidgetMapper, this one should call
the setModelData method of the delegate.
However, this doesn't seem to work, as far as I can see, the commitData
signal is emitted, but the setModelData never gets called, please find below
the code of the delegate. The full source code is at :
username and passwd : guest/guest
Any help or suggestion is appreciated !
def __init__(self, parts, parent=None):
self.parts = parts
def createEditor(self, parent, option, index):
return editors.CodeEditor(self.parts, self, parent)
def setEditorData(self, editor, index):
value = index.data(Qt.EditRole).toPyObject()
for part_editor, part in zip(editor.part_editors, value):
def setModelData(self, editor, model, index):
print 'Set model data called !!!'
from camelot.types import Code
value = 
for part in editor.part_editors:
def editingFinished(self, widget):
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt