[PyQt] QDataWidgetMapper and addMapping with a custom property name: setProperty never called

TP paratribulations at free.fr
Wed Nov 10 08:22:42 GMT 2010


If I am right, none of the properties of QTextEdit is virtual. So none can 
be reimplemented... It is not easy to change the default behavior in these 
conditions.
Finally I have found a solution: using QPlainTextEdit instead of QTextEdit: 
the default property is "plainText", not "html" as in QTextEdit. And so, I 
can subclass setEditorData() method of the delegate, and undertake some 
action before the value is set in QPlainTextEdit.

Fortunately there is QPlainTextEdit, otherwise I would be rather stuck.

Thanks,

Julien

Phil Thompson wrote:

> setProperty() isn't virtual so you can't reimplement it in Python.
> 
> Phil




More information about the PyQt mailing list