I am currently using this code to connect them by name and it actually works, is this the supported way of doing so?

Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication app(argc, argv);
  4. b.show();
  5.  
  6. // connect
  7. b.connect(&b, "2clicked()", &app, "1quit()");
  8.  
  9. // disconnect
  10. b.disconnect(&app, "1quit()");
  11.  
  12. return app.exec();
  13. }
To copy to clipboard, switch view to plain text mode 

The reason I am doing this is because I want to be able to save/load actions using xml file.