void MainWindow::startUpload(int ID, QString NAME) { qDebug() << ID; qDebug() << NAME; QSqlRecord recordAddFilePath = model->record(); recordAddFilePath.setValue(model->fieldIndex("file_path"),NAME); qDebug() << "filling Attach fielepath" << model->insertRecord(ID,recordAddFilePath); } 

in this situation adds a new row to the table, and I need to have changes in the current row (ID)

    1 answer 1

    insertRecord() adds rows. To update, use setRecord() :

     model->setRecord(ID, recordAddFilePath) 
    • Happened. Only when adding the rest of the data from the table disappears. Trying to understand what's the matter ... - Alexey Smirnov