The EditStrategy on this model has been set to OnManualSubmit (if it was set to OnFieldChange I could at least understand the behaviour).
---
void MainWindowImpl
::rowUpdated(int row,
QSqlRecord &record
) {
QString oldname
= model
->record
(row
).
value(3).
toString(),
newname = record.value(3).toString();
qDebug() << oldname << newname;
}
connect(model, SIGNAL(beforeUpdate(int,QSqlRecord &)), this, SLOT(rowUpdated(int,QSqlRecord &)));
---
void MainWindowImpl::rowUpdated(int row, QSqlRecord &record)
{
QString oldname = model->record(row).value(3).toString(),
newname = record.value(3).toString();
qDebug() << oldname << newname;
}
To copy to clipboard, switch view to plain text mode
I get the same 2 new updated strings.
I can work around by storing the old string each time a row gets selected etc but this is not supposed to be working this way or am I wrong?
Bookmarks