Thanks for the response mcosta.
I should have metioned thought that i tried that (submitAll() that is), but for some reason it did not work
here are the relevant pieces of code that were added to the code found at the URL:
hbox->addWidget(button);
connect(button,SIGNAL(clicked()),model,SLOT(submitAll()));
QPushButton *button = new QPushButton("button");
hbox->addWidget(button);
model->setEditStrategy(QSqlTableModel::OnManualSubmit);
connect(button,SIGNAL(clicked()),model,SLOT(submitAll()));
mapper.setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
To copy to clipboard, switch view to plain text mode
i then ran the code and and clicked my button to call submitAll(), after pressing CTRl+S to call submit() for the mapper. The attribute value in the view changed, but the value in the database remains untouched.
i found somthing in the docs called :
QAbstractItemDelegate::SubmitModelCache
To copy to clipboard, switch view to plain text mode
don't know if it can help, nor do i know how to access the delegate being used by the view to set it.
It is supposed to tell the delegate to write all cached data to the database.
any suggestions will be greatly appreciated.
Bookmarks