This will help you have to make two connections
connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked());
connect(button, SIGNAL(clickedSomeButton(B)), this, SLOT(buttonClicked(B)));
In the slot buttonClicked() do this
void buttonClicked(){
emit clickedSomeButton(B);
}
While using signal
and slots
you have to keep in mind that a slot
can have arguments equal or lesser than the signal it is connected to because of this reason your code is not working.
What you need to do is to create a slot for the clicked action of button one . Then in the slot you again emit one signal with the argument B ( This signal you need to define yourself ) which can be caught by the slot you mentioned i.e., buttonClicked(B)
For creating signal use this syntax
signals:
double clickedSomeButton(B &)