I'm not quite sure about your requirements, but QWidget (more specifically QObject) has a sender() method, which allows for retrieving the emitting object within a slot.
@
void doWidgetClick()
{
CustomWidget pSender = qobject_cast<CustomWidget>(sender());
}
@
For the "correct" solution design-wise you should consider using a "QSignalMapper":http://qt-project.org/doc/qt-4.8/qsignalmapper.html.
As to your code:
You cannot pass values using the connect() statement.
@
// WRONG, this is a value, not a type
connect(this, SIGNAL(click()), pReceiver, SLOT(doWidgetClick(this)));
idget*)));
@
Slots can only have less, not more arguments (excluding signal default arguments).
@
// WRONG, slot has more arguments than signal
// RIGHT, only if click signal has at least one default argument
connect(this, SIGNAL(click()), pReceiver, SLOT(doWidgetClick(QWidget*)));
@