[Interest] submit policy
Diego Schulz
dschulz at gmail.com
Thu May 24 00:41:12 CEST 2012
On Mon, May 21, 2012 at 9:15 AM, Stefan <nohoo77 at yahoo.com> wrote:
> Hello,
>
> this question is about the submit policy in QDataWidgetMapper.
>
> There is an AutoSubmit, which submits to the itemModel on focus lost.
> Also, there is a ManualSubmit, submitting only when called programatically.
> I prefer to use the auto submit policy, since I don't want to have an ok
> button on my dialog needing to be pressed in order to make the change
> permanent. I like that the data is changed immediatly.
>
> Unfortunately the data is not being submitted until the user defocuses the
> currently changed widget, which he might or might not.
> Eventually he will, one might thinkg, but in my case the connected ItemModel
> is a wrapper to an externally connected device sitting on the users desk,
> which he can access in parallel. In fact he is now checking this device for
> his currently made change, but since the autosubmit policy didn't fire yet,
> he gets a weird user experience.
> The same problem will occur with centralized databases, being accessed by
> multiple clients. One client changes a value in a widget and goes to lunch.
> The other client still sees the old data.
>
> Does anybody know of a creative way to come up with a custom submit policy?
> Like a SubmitOnValueChanged ? Or even a "timedelayed submit on value
> changed"-policy ?
>
> Please help
> This is bothering me for weeks now and nobody else at google seems to know
> :)
>
You're using QSqlTableModel, right? Have you tried adjusting
QSqlTableModel::EditStrategy to OnFieldChange?
>
> Thank you for any helpful input
> Stefan
>
More information about the Interest
mailing list