Quote Originally Posted by meissner
Ok, it works.

But how can I get the id from the QButton of the QButtonGroup that was clicked to use it in my SLOT?

For example:
Qt Code:
  1. QPushButton* cbutton = (QPushButton*)(sender());
  2. buttons->button( buttons->id( cbutton ) )->setText("bla");
To copy to clipboard, switch view to plain text mode 
This code produce an Segmentation fault and I guess the sender() funktion is stupid in this context, isn't it?
Yes in fact, that is one of the dangers of using sender() - you break the loose coupling and need to know exactly what kind of widget invoked the slot (of course using a C++-style dynamic_cast<> instead of (QPushButton*) as advised earlier would have trapped the error).

Change the signature of your function to take an int parameter. This will contain the id of the button that was pressed. Then you can do:

Qt Code:
  1. buttons->button(id)->setText("bla");
To copy to clipboard, switch view to plain text mode