PDA

View Full Version : Unable to modify QSqlRecord in QSqlRelationalTableModel



pippo42
22nd January 2010, 13:20
Hello,

I am trying to modify a QSqlRecord in a QSqlRelationalTableModel but it does not work.

If I do so and read the data after, I still obtain the old value.



model->record(i_model).setValue("param1", QVariant("TEST"));
cout << model->record(i_model).value("param1").toString().toStdString() << "\n"


If I try the example above, the second line displays the previous value instead of "TEST".

Thank you.

stevebakh
20th March 2010, 23:17
Hi, did you find a solution to this problem?

I have pretty much the same issue right now. I can't modify / set a value for a column that has a relation attached to it. If I remove the relation from the model, it works fine.

My thread is here: http://www.qtcentre.org/threads/29172-Unable-to-perform-setValue-on-QSqlRecord-when-model-has-relations