Does this even compile?

Anyway, QLineEdit doesn't have any toPlainText() function since it can only contain plain text.

Why don't you simply do something like this?
Qt Code:
  1. void MyClass::mySlot()
  2. {
  3. emit mySignal(myLineEdit->text());
  4. }
To copy to clipboard, switch view to plain text mode