int iSr=0;
QString stGeom,stImage,stVideo,stDateFrom,stDateTo;
iSr= ui->comboBoxSr->currentIndex();
stGeom="";
stImage="";
stVideo="";
stDateFrom="";
stDateTo="";
// c1 and c2 are dbcursor
qdb1.prepare("select * from f_get_data('c1', 'c2', ?, ?, ?, ?, ?, ?);fetch all in c1;fetch all in c2;");
qdb1.bindValue(0, iSr);
qdb1.bindValue(1, stGeom);
qdb1.bindValue(2, stImage);
qdb1.bindValue(3, stVideo);
qdb1.bindValue(4, stDateFrom);
qdb1.bindValue(5, stDateTo);
qdb1.setForwardOnly(true);
if(qdb1.exec()){
model1->setQuery(qdb1);
ui->tableViewMissionPlan->setModel(model1);
ui->tableViewMissionPlan->show();
}
QSqlQuery qdb1(db);
int iSr=0;
QString stGeom,stImage,stVideo,stDateFrom,stDateTo;
iSr= ui->comboBoxSr->currentIndex();
stGeom="";
stImage="";
stVideo="";
stDateFrom="";
stDateTo="";
// c1 and c2 are dbcursor
qdb1.prepare("select * from f_get_data('c1', 'c2', ?, ?, ?, ?, ?, ?);fetch all in c1;fetch all in c2;");
qdb1.bindValue(0, iSr);
qdb1.bindValue(1, stGeom);
qdb1.bindValue(2, stImage);
qdb1.bindValue(3, stVideo);
qdb1.bindValue(4, stDateFrom);
qdb1.bindValue(5, stDateTo);
qdb1.setForwardOnly(true);
if(qdb1.exec()){
QSqlQueryModel *model1 = new QSqlQueryModel;
model1->setQuery(qdb1);
ui->tableViewMissionPlan->setModel(model1);
ui->tableViewMissionPlan->show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks