[Qt-interest] Multiple SIGNAL connected to single SLOT and sender() function
Colin S. Miller
no-spam-thank-you at csmiller.demon.co.uk
Tue Nov 10 17:22:26 CET 2009
Sambhav,
Sambhav wrote:
> Thanks for the solution. But sender function is returning NULL.
> Do i need to enable/set anything to use this feature.
>
> On Tue, Nov 10, 2009 at 9:17 PM, Josiah Bryan
> <jbryan at productiveconcepts.com <mailto:jbryan at productiveconcepts.com>>
> wrote:
>
sender() only returns a valid object inside the SLOT() function.
Once the SLOT() function exits sender() returns NULL.
Also, dynamic_cast()<> will either raise an exception or
return NULL if the cast can't be completed due to run-time-type-information.
(i.e. the object is something else derived from QObject, not a QPushButton,
or something derived from QPushButton).
HTH,
Colin S. Miller
More information about the Qt-interest-old
mailing list