Qt Code:
  1. void mySlot() {
  2. QPushButton * b = qobject_cast<QPushButton *>(sender());
  3. if (b) {
  4. if (b == button1) {
  5. //button1 SIGNAL()ed
  6. } else if (b == button2) {
  7. //button2 SIGNAL()ed
  8. }
  9. }
  10. }
To copy to clipboard, switch view to plain text mode