vonCZ
8th November 2007, 16:53
hello-
I have a slot with the following code:
QSlider *locSlider = qobject_cast<QSlider *>(sender());
QButtonGroup *locBG = qobject_cast<QButtonGroup *>(sender());
if( QButtonGroup *locBG = qobject_cast<QButtonGroup *>(sender()) )
{ etc... }
if(locSlider == zXag[2])
{ etc.... }
if( (locSlider == NULL) && (locBG == NULL) )
{ etc... }
and 3 things connected to the slot: a QSlider, a QButtonGroup, and a custom signal, customSG. This works: if customSG makes the call, the appropriate conditional is entered (i.e. when locSlider and locBG are NULL). But... what if I want to connect two Signals? How can I determine which Signal made the call? Or in such situations, should I just code a 2nd SLOT?
I have a slot with the following code:
QSlider *locSlider = qobject_cast<QSlider *>(sender());
QButtonGroup *locBG = qobject_cast<QButtonGroup *>(sender());
if( QButtonGroup *locBG = qobject_cast<QButtonGroup *>(sender()) )
{ etc... }
if(locSlider == zXag[2])
{ etc.... }
if( (locSlider == NULL) && (locBG == NULL) )
{ etc... }
and 3 things connected to the slot: a QSlider, a QButtonGroup, and a custom signal, customSG. This works: if customSG makes the call, the appropriate conditional is entered (i.e. when locSlider and locBG are NULL). But... what if I want to connect two Signals? How can I determine which Signal made the call? Or in such situations, should I just code a 2nd SLOT?