[PyQt] How to use QDataWidgetMapper with OnFieldChange EditStrategy
Bryan Beutler
bryanbeutler at yahoo.com
Mon Feb 8 07:45:28 GMT 2010
Sorry, I should point out that the EditStrategy refers to the QSqlTableModel I am using.
Bryan
--- On Mon, 2/8/10, Bryan Beutler <bryanbeutler at yahoo.com> wrote:
> From: Bryan Beutler <bryanbeutler at yahoo.com>
> Subject: [PyQt] How to use QDataWidgetMapper with OnFieldChange EditStrategy
> To: pyqt at riverbankcomputing.com
> Date: Monday, February 8, 2010, 1:02 AM
> Hi,
>
> 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?
>
> Thanks,
> Bryan
>
>
>
>
>
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
More information about the PyQt
mailing list