PDA

View Full Version : QSqlRelationalTableModel fail update



Alexandru
13th June 2018, 17:08
My db 12861

personnelModel = new QSqlRelationalTableModel(this,db);
personnelModel->setTable("Personnel");
currentModel = operationModel;
currentModel->setRelation(currentModel->fieldIndex("Articul_idArticul"),QSqlRelation("Articul", "idArticul", "Number"));
// qDebug()<<currentModel->lastError()<<currentModel->query().lastQuery();
currentModel->setEditStrategy(QSqlRelationalTableModel::OnFieldC hange);
currentModel->select();
ui->tableView->setModel(currentModel);

The data is correctly displayed.
Qt does not issue errors.
After selecting in the combobox, the value is not updated, I looked up the database logs and saw it
12862
Why does "is null" appear?