It is not clear what you want to do.
If you have a few buttons with different background color and connected signal clicked to slo6t lets day onClick();
and within such slot you want to find color of the button background which was clicked,
first thing you need to find - which button was clicked.
There are a few ways to find it.
Simplest (not the best) is to call sender() within a slot.
Cast ( use qobject_cast) to a QPushButton* ( or whatever your buttons are ),
check its background if it is null.
Why this way is not the best? It makes an assumption that slot is only called as a result of button click,
which can't be guaranteed.
It is better to use QSignalMapper.