Signal and slots for all objects of a given class

Hi,

I’m trying to get one object being notified when any object of another class is “activated”. So I tried to use the static connect method :

TQObject::Connect(“AliMUONPainterMatrixFrame”,
“MouseLeave(AliMUONVPainter*)”,
“AliMUONPainterInfoWindow”,
infoWindow,
“MouseLeave(AliMUONVPainter*)”);

so that the infoWindow would be notified each time an object of class AliMUONPainterMatrixFrame emit the MouseLeave signal.

But this is not working.

If I now take one specific object of class AliMUONPainterMatrixFrame :

fPainterMatrixFrame->Connect(“MouseLeave(AliMUONVPainter*)”,
“AliMUONPainterInfoWindow”,
infoWindow,
“MouseLeave(AliMUONVPainter*)”);

then it works fine.

Do I misunderstand something and first case should not work ? Or is there something extra to do to handle that case ?

Thanks,

PS: Using Root 5.17.04 on Mac OS X 10.4.11

Hi,

Strange, it should work… Just take a look at how it is used in TGeoManager.cxx:

//_____________________________________________________________________________ void TGeoManager::Browse(TBrowser *b) { // Describe how to browse this object. if (!b) return; if (fMaterials) b->Add(fMaterials, "Materials"); if (fMedia) b->Add(fMedia, "Media"); if (fMatrices) b->Add(fMatrices, "Local transformations"); if (fOverlaps) b->Add(fOverlaps, "Illegal overlaps"); if (fTracks) b->Add(fTracks, "Tracks"); if (fMasterVolume) b->Add(fMasterVolume, "Master Volume", fMasterVolume->IsVisible()); if (fTopVolume) b->Add(fTopVolume, "Top Volume", fTopVolume->IsVisible()); if (fTopNode) b->Add(fTopNode); TString browserImp(gEnv->GetValue("Browser.Name", "TRootBrowserLite")); TQObject::Connect(browserImp.Data(), "Checked(TObject*,Bool_t)", "TGeoManager", this, "SetVisibility(TObject*,Bool_t)"); }
Could you post a piece of code reproducing the problem?

Cheers,
Bertrand.