Hi Mark,
thank you for your response!

I have been looking at the QItemDelegate class but am pretty unsure what method 
to override.
Can you point me to the right direction?

Thank you in advance

Stefan



________________________________
 From: Mark Brand <mabr...@mabrand.nl>
To: Stefan <noho...@yahoo.com> 
Cc: Diego Schulz <dsch...@gmail.com>; "interest@qt-project.org" 
<interest@qt-project.org> 
Sent: Thursday, May 24, 2012 4:48 PM
Subject: Re: [Interest] submit policy
 
>> You're using QSqlTableModel, right? Have you tried adjusting
>> QSqlTableModel::EditStrategy to OnFieldChange?

> I am not using the QSqlTableMode, I am implementing my own 
> QAbstractItemModel, wrapping some driver calls to an USB device.
> 
> But even if I would use QSqlTableModel, I would run into the same problems, 
> since "OnFieldChange" only makes sure that "All changes to the model will be 
> applied immediately to the database". My problem is that the "changes to the 
> model" come in too late already (they come in on focus lost).

That's right, this is about the behavior of QDataWidgetMapper (sort of a 
"view") not the model. The OP wants changes to be submitted to the model even 
if the focus never leaves the mapped widget.

I'm pretty sure that this default behavior of QDataWidgetMapper is actually  
defined by the delegate, which is QItemDelegate by default. You could use 
QDataWidgetMapper::setDelegate() to use your own subclassed delegate instead.

regards,

Mark
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to