void IS on_pushButton_loadta bl_clicked IS conn QSqlQuery qry QSqlQuer

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
void IS::on_pushButton_loadtabl_clicked()
{
IS conn;
//QSqlQuery qry;
QSqlQueryModel * modal=new QSqlQueryModel();
conn.connOpen();
QSqlQuery* qry=new QSqlQuery(conn.ZOO);
qry->prepare("select * from ZOO1");
qry->exec();
modal->setQuery(*qry);
ui->tableView->setModel(modal);
conn.connClose();
qDebug() << (modal->rowCount());
ui->pushButton_loadtabl->setEnabled(false);
ui->pushButton_loadtabl->setText("База данных загружена");
}