I have tested your code and it returns "2".

Something strange is happening, because when I change
Qt Code:
  1. query.prepare("select :a / :b");
To copy to clipboard, switch view to plain text mode 
to
Qt Code:
  1. query.prepare("select :a + :b");
To copy to clipboard, switch view to plain text mode 
or
Qt Code:
  1. query.prepare("select :a - :b");
To copy to clipboard, switch view to plain text mode 
or
Qt Code:
  1. query.prepare("select :a * :b");
To copy to clipboard, switch view to plain text mode 

it returns me the right result.
Do you see anything wrong with my code?


Renan