Hi, I don't really understand what QWidget.addAction() does even after reading the documentation, I do the following:

connect(action_Close, SIGNAL(triggered()), this, SLOT(close()) );
buttonClose->addAction(action_Close);


I figure that the above code would cause clicking buttonClose to call close() and close the window. But nothing happen, what am I doing wrong?

The compiler output doesn't show any error about assigning the signal and slot. And close() is a SLOT in QWidget.