Sorry to ask but I am unsure how to use qDebug to check for errors in the model (what member should I use?)
Not sure if this will help but here is the code for the view and the model:
//Note: "medadmin" is the name of the table in the SQLite3 database
model->setTable ("medadmin");
model->select();
qDebug << model->error();
//The following lines edit a couple of parameters in the table view "View" and bind it to the model
ui->View->setWindowTitle ("Patients List");
ui->View->setModel (model);
ui->View->resizeColumnsToContents();
ui
->View
->setSelectionMode
(QTableView::SingleSelection);
ui->View->setVisible (true);
ui->View->setColumnHidden(0, true);
//Note: "medadmin" is the name of the table in the SQLite3 database
model->setTable ("medadmin");
model->select();
qDebug << model->error();
//The following lines edit a couple of parameters in the table view "View" and bind it to the model
ui->View->setWindowTitle ("Patients List");
ui->View->setModel (model);
ui->View->setSelectionBehavior (QAbstractItemView::SelectRows);
ui->View->resizeColumnsToContents();
ui->View->setSelectionMode (QTableView::SingleSelection);
ui->View->setVisible (true);
ui->View->setColumnHidden(0, true);
To copy to clipboard, switch view to plain text mode
Bookmarks