Hello! QAction is meant to work together with QPushButtons, right? Somehow it doesn't work out for me. I defined a QAction and it works nicely on a QMenuBar, but when I try to add it to a QPushButton, nothing happens. I mean the button doesn't trigger the action. Here is my code.

Qt Code:
  1. QAction* recordAction = new QAction(tr("&Record"), this);
  2. recordAction->setToolTip(tr("Toggles recording."));
  3. recordAction->setShortcut(QKeySequence(tr("Return")));
  4. connect(recordAction, SIGNAL(triggered()), this, SLOT(record()));
  5.  
  6. QMenuBar* menuBar = new QMenuBar();
  7. menuBar->addAction(recordAction);
  8.  
  9. ui.recordButton->addAction(recordAction);
To copy to clipboard, switch view to plain text mode 

The button and the whole ui has been created with Qt Designer.
What am I doing wrong?