Hi. how do i connect signal to static slot?
something like this:
class myStaticClass
{
static void method(obj o)
{
QtObject::connect(o, SIGNAL(sig()), myStaticClass, SLOT(slt()));
}
static void slt()
{
//my slot
}
}
Hi. how do i connect signal to static slot?
something like this:
class myStaticClass
{
static void method(obj o)
{
QtObject::connect(o, SIGNAL(sig()), myStaticClass, SLOT(slt()));
}
static void slt()
{
//my slot
}
}
Hi, first of all your class needs Q_OBJECT macro to work; Second thing, the Qt meta system won't work with your class because you have to initialize the object instance before to run static method(obj).
BTW Why do you need such code? What's the purpose?
Well, try to use them in the right way. If you have doubts, just ask