Cannot update a table with this code

Qt Code:
  1. QString str;
  2. int ord = n_ord->text().toInt();
  3. query = QSqlQuery ("UPDATE leg SET dip = '"+ str +"' WHERE n_ord = "+ ord +" LIMIT 1");
To copy to clipboard, switch view to plain text mode 

"n_ord" is an integer primary key table field and "ord" its actual value

Can someone helps ?
Thanks in advance