Bruschetta
30th September 2016, 09:46
Hello,
i'm trying to edit a table cell of my QTablView but with no luck.
The code of the function i'm calling to populate it is:
void perito::on_pushButton_listaP_clicked()
{
Conn conn;
QSqlQueryModel *modal = new QSqlQueryModel();
conn.connectionOpen();
QSqlQuery *qry = new QSqlQuery(conn.mydb);
qry->prepare("SELECT * FROM perito");
qry->exec();
modal->setQuery(*qry);
ui->tableView->setModel(modal);
conn.connectionClose();
}
The table is well populated but i'm unable to modify any cell. I have made the table with designer but the field "NoEditTriggers" is unchecked ..
Any hints? Thanks for your time and answers
i'm trying to edit a table cell of my QTablView but with no luck.
The code of the function i'm calling to populate it is:
void perito::on_pushButton_listaP_clicked()
{
Conn conn;
QSqlQueryModel *modal = new QSqlQueryModel();
conn.connectionOpen();
QSqlQuery *qry = new QSqlQuery(conn.mydb);
qry->prepare("SELECT * FROM perito");
qry->exec();
modal->setQuery(*qry);
ui->tableView->setModel(modal);
conn.connectionClose();
}
The table is well populated but i'm unable to modify any cell. I have made the table with designer but the field "NoEditTriggers" is unchecked ..
Any hints? Thanks for your time and answers