//#include //#include #include "QTsignal.h" //#include "TRint.h" #include "TApplication.h" #include using namespace std; // Main program ClassImp(A) void A::SetValue(Int_t value) { // Set new value // Emit signal "SetValue(Int_t)" with a single parameter if (value != fValue) { fValue = value; Emit("SetValue(Int_t)", fValue); cout << " Signal Emited!" << endl; } } int main(int argc, char **argv) { //QTsignal(){// TApplication *app = new TApplication("qtsignals", &argc, argv); A* a = new A(); A* b = new A(); a->Connect("SetValue(Int_t)", "A", b, "SetValue(Int_t)"); printf("n******* Test of SetValue(Int_t) signal *******n\n"); b->SetValue(10); printf("nt***** b before ******n\n"); b->PrintValue(); a->SetValue(20); printf("t***** b after a->SetValue(20) ******n\n"); b->PrintValue(); app->Run(); return 0; }