PDA

View Full Version : Identifying signal emitter



alan lenton
7th October 2009, 06:29
Is there a way to identify the widget sending a signal if I connect a bunch of different widgets to the same slot?

I have six QLineEdits on which I want to update the tools tip when the editingFinished () signal is sent. I would prefer to keep the processing to a minimum by only resetting the ToolTip for the edit that changed, rather than resetting all of them each time.

Actually, it's not the processing, it just feels wrong to do all of them when only one is necessary!

alan

yogeshgokul
7th October 2009, 06:32
QSignalMapper is your friend. ;)

SABROG
7th October 2009, 06:59
QObject::sender()

kwisp
7th October 2009, 07:14
It`s very often(oftentimes) problem.
I think it must be add to FAQ.

alan lenton
7th October 2009, 17:16
I suspect you might be correct about putting it in the FAQ.

Thanks for the help guys.

alan