The watch button fixed!!!

This commit is contained in:
danylo-nevidomiy 2022-01-09 02:56:33 +03:00
parent d6b7af2244
commit 1cf146112a

View File

@ -103,8 +103,11 @@ void MainWindow::putRecord(Record* record){
Record* MainWindow::getRecord(int index) Record* MainWindow::getRecord(int index)
{ {
QVariant x = model->record(index-1).value(0);
int id;
id = x.toInt();
query->prepare("SELECT * FROM records WHERE id = (:id)"); query->prepare("SELECT * FROM records WHERE id = (:id)");
query->bindValue(":id", index); query->bindValue(":id", id);
query->exec(); query->exec();
// QSqlRecord rec = query->record(); // QSqlRecord rec = query->record();
//// query->next(); //// query->next();