Set the text as rich text, not as plain text.
Qt Code:
  1. widget->setText("<html><body>My long title</body></html>");
To copy to clipboard, switch view to plain text mode