[PyQt] How to use QDataWidgetMapper with OnFieldChange EditStrategy

Bryan Beutler bryanbeutler at yahoo.com
Mon Feb 8 07:02:34 GMT 2010


I've used QDataWidgetMapper with the OnManualSubmit strategy with no problems.  

Now I have a form that I need to update the database immediately after each widget is edited as the user traverses the form.   I set the edit strategy to OnFieldChange.   The database gets updated only on the first widget edited.  

For testing purposes, I called model.select() and mapper.toFirst() after the first widget was edited.  The next widget edited now updates to the database, but no more after that.

Do I have to call select() and toFirst() after every edit?  This does not seem practical.  Am I missing something?



More information about the PyQt mailing list