From: Norbert Moutarde Date: Fri, 8 Jan 2016 11:42:32 +0000 (+0100) Subject: added the possibility to get multiple SQL call (2 yet) X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=077caf69c4ef2229de58f73a932ef85d1125c730;p=diary-mobile.git added the possibility to get multiple SQL call (2 yet) --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 10b9ca9..b5a3f22 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -289,13 +289,13 @@ void MainWindow::action(const QString &a){ if(!page)tmp=q->seek(0); else tmp=q->seek(-t-max-1,true); if(deb)QMessageBox::information(this, trUtf8("result", "box title to debug prevpage"), int(tmp)); - printItem(); + printItem(*q); } else if(b[0]==QString("nextpage")){ page++; flush(); - printItem(); + printItem(*q); } else if(b[0]==QString("setfile")){ bool ok=0; @@ -768,7 +768,7 @@ void MainWindow::get(const QString & d, const QString &b){ exec(tmp); page=0; //while(q->next()){ - printItem(); + printItem(*q); //} } void MainWindow::chooseDB(){ @@ -1232,7 +1232,7 @@ void MainWindow::reset(){ QList b({"delete from buttons;"}); exec(b); } -bool MainWindow::printItem(){ +bool MainWindow::printItem(const QSqlQuery & a){ int labCol = 0;//r.indexOf("label"); int actCol = 1;//r.indexOf("action"); int i=0; @@ -1241,8 +1241,8 @@ bool MainWindow::printItem(){ addWidget(QString("prevpage"), new CLabel(trUtf8("Prev"), *conf)); }; - while(q->next()){ - int tmp=addWidget(q->value(actCol).toString(), new CLabel(q->value(labCol).toString(), *conf)); + while(a.next()){ + int tmp=addWidget(a.value(actCol).toString(), new CLabel(a.value(labCol).toString(), *conf)); if(tmp==1){ addWidget(QString("nextpage"), new CLabel(trUtf8("Next"), *conf)); return 1; @@ -1256,3 +1256,23 @@ bool MainWindow::printItem(){ qDebug()<<"end printItem : "<value(t).toString(); + qDebug()<<"l691 x="<