What about
Qt Code:
  1. QString string(text);
To copy to clipboard, switch view to plain text mode 
?