This is my code:
query.prepare("select :a / :b");
query.addBindValue( ui.a_lineEdit->text() );
query.addBindValue( ui.b_lineEdit->text() );
query.exec();
while (query.next()) {
QString res
= query.
value(0).
toString();
ui.res_lineEdit->setText(res);
QSqlQuery query;
query.prepare("select :a / :b");
query.addBindValue( ui.a_lineEdit->text() );
query.addBindValue( ui.b_lineEdit->text() );
query.exec();
while (query.next()) {
QString res = query.value(0).toString();
ui.res_lineEdit->setText(res);
To copy to clipboard, switch view to plain text mode
ui.a_lineEdit->text() is 9 and ui.b_lineEdit->text() is 3
If I try to +,- or * the result shows up in ui.res_lineEdit->setText(res), but when I try to divide it doesnt show me anything. Why?
Renan
Bookmarks