Have you looked at Signals and Slots? It a way of linking events between two objects.

For your problem, you'll need to write a function (to activate on the pushbutton being clicked) that would do something along the lines of
Qt Code:
  1. QString var = linedit.text();
To copy to clipboard, switch view to plain text mode 

Connect that with the pushbutton clicked.