Priority: Not Evaluated
Affects Version/s: 4.7.4, 4.8.1, 5.0.2
Fix Version/s: None
Component/s: Widgets: Itemviews
I tested it on Qt 5.0.2, 4.7.4 and 4.8.1 so this issue probably applies to Qt 5 and and previous versions of Qt 4.
Custom widget inherits from QWidget. Has:
Q_PROPERTY(QDate date READ date WRITE setDate NOTIFY dateChanged USER true )
All methods are defined properly.
I use QSqlTableModel.My widget has QCheckBox and QDateEdit. I use delegate to format date for SQLite. I have two situations:
1. Without mapper->setSubmitPolicy (default is QDataWidgetMapper::AutoSubmit).
setModelData from delegate is invoked for Qt widgets(QDateEdit too) but not when I set value in my widget.
2. With mapper->setSubmitPolicy( QDataWidgetMapper::ManualSubmit ).
submit() is called when dialog is accepted. In this case setModelData operates on Qt widgets and take value from my widget too.
So issue is that QDataWidgetMapper doesn't get value from custom widget when has a submit policy AutoSubmit