enum MyEnum {Foo, Bar, Baz ....};...connect(this, Foo, other, SLOT(fooAction()));...void callSomeActions(MyEnum t){ emit t;}
class caller_base{public: virtual void call() = 0; virtual ~caller_base() {}};template<class type> class caller : public caller_base{ type *ptr; void (type::*fun)(); public: caller(type *p, void (type::*f)()) : ptr(p), fun(f) {} virtual void call() { (ptr->*fun)(); }};enum MyEnum {Foo, Bar, Baz};QHash<int, caller_base *> hash;template <class type>void myConnect(MyEnum t, type *ptr, void (type::*fun)()){ hash[t] = new caller<type>(ptr, fun);}void myEmit(int i){ if(hash.contains(i)) hash[i]->call();}