Qt Code:
  1. QLineEdit::text()
  2. QLabel::setText()
To copy to clipboard, switch view to plain text mode 

and read Qt Documentation.