I am trying to code a static callback function that is called frequently from another static function within the same class. My callback function needs to emit
a signal but for some reason it simply fails to do so. I have put it under a debugger and the slot
never gets called. However when I place the code I used to emit
the data in a non-static function it works. Is there a reason I cannot emit a signal from a static function? I have tried declaring a new instance of the class and calling the emit function but with no luck.
class Foo
{
signals:
emitFunction(int);
private:
static int callback(int val)
{
/* Called multiple times (100+) */
Foo *foo = new Foo;
foo.emitFunction(val);
}
void run()
{
callback(percentdownloaded);
}
};
I have posted some basic code that demonstrates what I am attempting to do. I will post full code upon request.
Edit: I am posting the full code since this is kind of an odd scenario. http://pastebin.com/6J2D2hnM