How about just:
Qt Code:
  1. QString s = qr.value(0).toString();
  2. res = s;
To copy to clipboard, switch view to plain text mode 

Provided the appropriate column in the table is declared properly as a string column, Qt should automatically use the proper conversion.