Hi,

I am trying to run a function when a Qt Push button is pressed. Here are my code snippets:

Interface header file
Qt Code:
  1. QPushButton *button;
  2. button = new QPushButton(tab);
  3. button->setObjectName(QString::fromUtf8("action_button"));
  4. button->setGeometry(QRect(20, 30, 210, 131));
To copy to clipboard, switch view to plain text mode 

Class Constructor
Qt Code:
  1. connect(ui.action_button, SIGNAL(activated()), this, SLOT(function()));
To copy to clipboard, switch view to plain text mode 

Some help would be great!