From: Norbert Moutarde Date: Sat, 24 May 2014 08:48:17 +0000 (+0200) Subject: added the ability to customize sql sentence on the fly X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=bf9ef3907ce5ea52b255ac88bdfe45b5cfc3895c;p=diary-mobile.git added the ability to customize sql sentence on the fly --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 8ba3c2b..fe7c7d6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -218,7 +218,17 @@ void MainWindow::action(const QString &a){ way.clear(); } else if(b[0]==QString("sql")){ - exec(QList ({c})); + int value=c.count(QString("?")); + QList cmd({c}); + if (value){ + for(int d=0; d<=value; d++){ + bool ok; + QString e=QInputDialog::getText(this, "set", "value ?", QLineEdit::Normal, QString(""), &ok); + if(ok)cmd.append(e); + else break;// in case of break, exec complain about cmd size + } + } + exec(cmd); } else if(b[0]==QString("edit")){ QString e;