Qt Code:
  1. void PatientGui::setID(const QString &value)
  2. {
  3. ID = ui->nric->text();
  4. }
To copy to clipboard, switch view to plain text mode 
makes little sense. Try:
Qt Code:
  1. void PatientGui::setID(const QString &value)
  2. {
  3. ID = value;
  4. }
To copy to clipboard, switch view to plain text mode 
if you want the obvious setter to match your getter.