aguleo
6th December 2013, 15:45
Hello,
This code inserts records in a MySQL table:
int row = 0;
model->insertRows(row,1);
QModelIndex index = model->index(row, model->fieldIndex("idPK"));
view->setCurrentIndex(index);
view->edit(index);
If i repeat the the value in the Primary Key or leave NULL a mandatory field, the data will remain visible in the view but, as soon as i refresh the model, i realise it was not there.
How showld i control this?
This code inserts records in a MySQL table:
int row = 0;
model->insertRows(row,1);
QModelIndex index = model->index(row, model->fieldIndex("idPK"));
view->setCurrentIndex(index);
view->edit(index);
If i repeat the the value in the Primary Key or leave NULL a mandatory field, the data will remain visible in the view but, as soon as i refresh the model, i realise it was not there.
How showld i control this?