From bf9ef3907ce5ea52b255ac88bdfe45b5cfc3895c Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Sat, 24 May 2014 10:48:17 +0200 Subject: [PATCH] added the ability to customize sql sentence on the fly --- mainwindow.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; -- 2.45.1