Cannot use signals and slots with compiled root code

Hi
Im trying to make a GUI with signals and slots compling against the ROOT.
The following doesnt work.

PhosNumberEntry *configIdInputPtr; //TGNumberEntry overriding the Valuchangefunction

PHOS::MainMenu::MainMenu
{
configIdInputPtr->Connect(“ValueChanged(Long_t t)”, “PHOS::MainMenu”, this,
“myslot(Long_t)”);

}

void
PHOS::MainMenu::myslot(Long_t t)
{
printf("\n myslot, HELLO WORLD\n");
}

Inside the PhosNumberEntry class the method Valuechanged is overriden like
this.

void
PhosNumberEntry::ValueChanged(Long_t t)
{
Long_t args[1];
args[0] = t;

Emit(“ValueChanged(Long_t t)”, args);

}

Im not running the rootcint so I don have a classdef/classimp or a Lindef file
however all the classes inherits from TQObject.

Any ideas why this doesnt work ?

best regards
Per Thomas Hille

Hi Per Thomas Hille,

Signals/slots mechanism uses dictionary information. It is important also how do you override signal method and when it is emitted. It will be better if you send as simple as possible running example we could run.

Please review your code according to the following minor changes - only parameter type is included in the signal name used in the Connect method:PHOS::MainMenu::MainMenu { configIdInputPtr->Connect("ValueChanged(Long_t)", "PHOS::MainMenu", this, "myslot(Long_t)"); }
and the same when Emit is called:PhosNumberEntry::ValueChanged(Long_t t) { Long_t args[1]; args[0] = t; ..... Emit("ValueChanged(Long_t)", args); }Cheers, Ilka