I'm using a QTableView and a QSqlRelationalTableModel. I have successfully implemented QItemDelegates that use a QDateTimeEdit and QLineEdit.
In particular if I:
modify the text in the QLineEdit I use for my QItemDelegate
call submitAll() on the model
then QItemDelegate::setModelData() is correctly called. ie the model is updated and the modified text saved to the database.
However, if instead my QItemDelegate editor is a "compound" editor, say a QWidget to which I've added a QLineEdit (rather than just a QLineEdit by itself), then setModelData() isn't called in the above circumstances.
On the other hand if I
navigate away from my "compound" editor or if I press return
then setModelData() is correctly called.
Any ideas on why my "compound" editor isn't fully working? I presume that if I use a simple editor the model knows that the data in the editor has changed, but if I use a compound editor the necessary events are being blocked.