JeanC
29th January 2008, 15:12
The EditStrategy on this model has been set to OnManualSubmit (if it was set to OnFieldChange I could at least understand the behaviour).
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;
}
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?
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;
}
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?