[Qt-interest] Unknown signal sender
Andreas Pakulat
apaku at gmx.de
Thu Sep 1 15:10:50 CEST 2011
On 01.09.11 14:38:30, Lucas.Betschart at crypto.ch wrote:
> Thanks, that worked.
>
> Btw, I think the documentation example from QSignaleMapper is wrong.
>
>
> connect(signalMapper, SIGNAL(mapped(const QString &)),
> this, SIGNAL(clicked(const QString &)));
>
>
> Shouldnt this be SLOT at the second line?
No, the example creates a widget which has a special clicked signal
telling you which button was clicked by adding the text parameter. Since
the class itself has no use for knowing which button was clicked there's
no point in writing a slot as signals can be connected directly.
Andreas
More information about the Qt-interest-old
mailing list