Your toolbar probably contains one or more QToolButtons. When such button is clicked, the clicked signal for that button is emitted. To react to the signal, you must have in the constructor of your class something like this:
Qt Code:
  1. connect(myButton, SIGNAL(clicked()), this, SLOT(mySlot()));
To copy to clipboard, switch view to plain text mode 
Then every time the button is clicked, the code in function mySlot() is executed.

In your GeneratorClass.h you have something like:
Qt Code:
  1. private slots:
  2. void mySlot();
To copy to clipboard, switch view to plain text mode 

And.. please read the Qt-docs about signals and slots. It really helps...