Either you will need to subclass QPushButton and reimplement keyEvents and mouseEvents.
Or you will need to have separate slots for each button like this.
vector <QPushButton*> pb;
pb.push_back(pushButton0);
pb.push_back(pushButton1);
..........................
connect(pushButton0, SIGNAL(clicked()), this, SLOT(butto0Slot()));
connect(pushButton1, SIGNAL(clicked()), this, SLOT(butto1Slot()));
vector <QPushButton*> pb;
pb.push_back(pushButton0);
pb.push_back(pushButton1);
..........................
connect(pushButton0, SIGNAL(clicked()), this, SLOT(butto0Slot()));
connect(pushButton1, SIGNAL(clicked()), this, SLOT(butto1Slot()));
To copy to clipboard, switch view to plain text mode
Bookmarks