It's not how it's done. You should connect their activated() or triggered() signal to a slot which implements the functionality. For example:

Qt Code:
  1. connect(act2, SIGNAL(triggered()), this, SLOT(close()));
To copy to clipboard, switch view to plain text mode